using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class OpenServerActivityNotifyWin : Window
|
{
|
[SerializeField] FlashRushToBuyNotify flashRushToBuyNotify;
|
OpenServerActivityNotifyModel activityNotifyModel { get { return ModelCenter.Instance.GetModel<OpenServerActivityNotifyModel>(); } }
|
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(CrossServerUtility.IsCrossServerOneVsOne() || ArenaManager.isArenaClient)
|
{
|
flashRushToBuyNotify.SetActive(false);
|
return;
|
}
|
|
OperationFlashRushToBuy.FlashSaleShop saleShop = null;
|
if(activityNotifyModel.flashSaleShops.Count > 0)
|
{
|
saleShop = activityNotifyModel.flashSaleShops[activityNotifyModel.flashSaleShops.Count - 1];
|
}
|
if (saleShop != null && !activityNotifyModel.closeflashSaleShops.Contains(saleShop))
|
{
|
flashRushToBuyNotify.SetActive(true);
|
}
|
else
|
{
|
flashRushToBuyNotify.SetActive(false);
|
}
|
}
|
}
|
}
|