//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, January 21, 2019 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; namespace Snxxz.UI { public class JadeDynastyTowerFloorBehaviour : MonoBehaviour { [SerializeField] Image m_Floor; [SerializeField] Button m_Selected; [SerializeField] TextEx m_FloorName; [SerializeField] Image m_Challenge; [SerializeField] Image m_Cover; [SerializeField] RectTransform m_ContainerSelected; [SerializeField] UIEffect m_GateEffect; RectTransform m_RectTransform; RectTransform rectTransform { get { return m_RectTransform ?? (this.transform as RectTransform); } } JadeDynastyTowerModel model { get { return ModelCenter.Instance.GetModel(); } } int floorId = 0; public void Display(int _floorId) { this.floorId = _floorId; var isOpened = this.model.currentFloor >= this.floorId; var config = JadeDynastyTowerConfig.Get(floorId); m_FloorName.text = config.floorName; m_Cover.gameObject.SetActive(this.model.currentFloor > this.floorId); if (this.model.currentFloor == this.floorId) { m_GateEffect.Play(); m_Challenge.gameObject.SetActive(true); m_ContainerSelected.gameObject.SetActive(true); m_FloorName.color = UIHelper.GetUIColor(TextColType.NavyYellow); } else { m_GateEffect.Stop(); m_Challenge.gameObject.SetActive(false); m_ContainerSelected.gameObject.SetActive(false); m_FloorName.color = UIHelper.s_LightYellow; } } public void Dispose() { } } }