| | |
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | |
|
| | | bool isLogin = true;
|
| | | public override void Init()
|
| | | {
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.MysticalPurchase, this);
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | storeModel.RefreshBuyShopLimitEvent -= UpdateBuyTimes;
|
| | | isLogin = true;
|
| | | mysticalShopDict.Clear();
|
| | | GlobalTimeEvent.Instance.halfMinuteEvent -= UpdateSecond;
|
| | | storeModel.RefreshBuyShopLimitEvent -= UpdateBuyTimes;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | isLogin = false;
|
| | | GlobalTimeEvent.Instance.halfMinuteEvent += UpdateSecond;
|
| | | storeModel.RefreshBuyShopLimitEvent += UpdateBuyTimes;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | |
| | |
|
| | | public bool IsAdvance { get { return false; } }
|
| | |
|
| | | public bool priorityOpen { get { return false; } }
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return mysticalRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 更新物品购买次数
|
| | |
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | #region 协议
|
| | | private Dictionary<int, MysticalShop> mysticalShopDict = new Dictionary<int, MysticalShop>();
|
| | | public void UpdateMysticalShopInfo(HA806_tagMCMysticalShopTimeInfo info)
|
| | |
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.MysticalPurchase);
|
| | | }
|
| | |
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public MysticalShop GetMysticalShop(int shopId)
|
| | |
| | | return endSec > 0 ? endSec : 0;
|
| | | }
|
| | | }
|
| | |
|
| | | #region 红点
|
| | | public const int MysticalRedKey = 20918;
|
| | | public Redpoint mysticalRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, MysticalRedKey);
|
| | | public void UpdateRedpoint()
|
| | | {
|
| | | if (isLogin) return;
|
| | |
|
| | | if(IsOpen)
|
| | | {
|
| | | mysticalRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | mysticalRedpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateSecond()
|
| | | {
|
| | | if (isLogin || !priorityOpen) return;
|
| | |
|
| | | if(!IsOpen)
|
| | | {
|
| | | CloseRedPoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public void CloseRedPoint()
|
| | | {
|
| | | mysticalRedpoint.state = RedPointState.None;
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|