using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using Games.GlobeDefine; using GCGame.Table; using GCGame; using System; public class MarketingWinMenuItemCS : UIItemSelect { public Text _MenuText; public Text _HLMenuText; public GameObject _RedDot; public Text remainTime; public int _ActId; public override void Show(Hashtable hash) { base.Show(hash); MarketingActState actState = (MarketingActState)hash["InitObj"]; ShowActState(actState); RefreshActState(actState.state); } protected virtual void ShowActState(MarketingActState actState) { _ActId = actState.actID; var actInfo = TableManager.GetActInfoClientByID(actState.actID, 0); if(_MenuText != null) { _MenuText.text = actInfo.Name; if(_HLMenuText != null) { _HLMenuText.text = actInfo.Name; } } if (_RedDot != null) { _RedDot.SetActive(actState.state > 0); remainTime.text = (actState.state >= 99 ? 99 : actState.state).ToString(); } } public void RefreshActState(int state) { _RedDot.SetActive(state > 0); remainTime.text = (state >= 99 ? 99 : state).ToString(); } }