using System; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class OpenServerActivityNotifyWin : Window { [SerializeField] FlashRushToBuyNotify flashRushToBuyNotify; OpenServerActivityNotifyModel activityNotifyModel { get { return ModelCenter.Instance.GetModel(); } } protected override void BindController() { } protected override void AddListeners() { } protected override void OnPreOpen() { activityNotifyModel.UpdateFlashRushToBuyEvent += CheckFlashRushToBuy; CheckFlashRushToBuy(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { activityNotifyModel.UpdateFlashRushToBuyEvent -= CheckFlashRushToBuy; } protected override void OnAfterClose() { } private void CheckFlashRushToBuy() { if(activityNotifyModel.flashSaleShops.Count > 0) { flashRushToBuyNotify.gameObject.SetActive(true); } else { flashRushToBuyNotify.gameObject.SetActive(false); } } } }