//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Saturday, March 17, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace vnxbqy.UI { public class TreasureInfoWin : Window { [SerializeField] Text m_TreasureName; [SerializeField] Text m_Content; [SerializeField] TreasureIntroducePanel m_IntroducePanel; [SerializeField] Button m_Close; TreasureModel model { get { return ModelCenter.Instance.GetModel(); } } #region Built-in protected override void BindController() { } protected override void AddListeners() { m_Close.AddListener(CloseClick); } protected override void OnPreOpen() { var config = TreasureConfig.Get(model.selectedTreasure); m_TreasureName.text = config.Name; m_Content.text = config.Story; Treasure treasure; if (model.TryGetTreasure(model.selectedTreasure, out treasure)) { m_IntroducePanel.SetActive(true); m_IntroducePanel.Display(treasure); } else { m_IntroducePanel.SetActive(false); } } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } #endregion } }