| | |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FlashSaleModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class FlashSaleModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | public override void Init()
|
| | |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | OpenServerActivityCenter.Instance.Register(4, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | if (type == Operation.FlashSale && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (type == Operation.FlashSale && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase);
|
| | | return operationBase != null && operationBase.SatisfyOpenCondition() && operationBase.InAdvanceTime(TimeUtility.ServerNow);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return flashSaleRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20904);
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | flashSaleRedpoint.state = RedPointState.None;
|