| | |
| | | {
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
|
| | | limitedTimePackageItemModel.UpdateLimitedTimePackageItem += UpdateLimitedTimePackageItem;
|
| | | GlobalTimeEvent.Instance.secondEvent += secondEvent;
|
| | | time = 0;
|
| | | m_Buy_Btn.interactable = true;
|
| | | DisPlay();
|
| | |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase))
|
| | | {
|
| | | GiftPackageClass operation = operationBase as GiftPackageClass;
|
| | | m_Text_ActivityTimeTo.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime());
|
| | | // m_Text_ActivityTimeTo.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime());
|
| | | var index = operation.IndexOfFlashShop();
|
| | | if (index != -1 && index < operation.giftpackage1.Count)
|
| | | {
|
| | |
| | | {
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
|
| | | limitedTimePackageItemModel.UpdateLimitedTimePackageItem -= UpdateLimitedTimePackageItem;
|
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent;
|
| | | }
|
| | |
|
| | | |
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | private void secondEvent()
|
| | | {
|
| | | int time = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.GiftPackage);
|
| | | if (time <= 0)
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("LimitGift2");
|
| | | }
|
| | | if (time > 86400)
|
| | | {
|
| | | m_Text_ActivityTimeTo.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!m_Text_ActivityTimeTo.gameObject.activeSelf)
|
| | | {
|
| | | m_Text_ActivityTimeTo.gameObject.SetActive(true);
|
| | | }
|
| | | if (time < 3600)
|
| | | {
|
| | | m_Text_ActivityTimeTo.text =Language.Get("LimitGift1")+":"+ TimeUtility.SecondsToHMS(time);
|
| | | m_Text_ActivityTimeTo.color = UIHelper.GetUIColor(TextColType.Green);
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("LimitGift1") + ":" + TimeUtility.SecondsToHMS(time);
|
| | | m_Text_ActivityTimeTo.color = UIHelper.GetUIColor(TextColType.Green);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | }
|