| | |
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | SecondEvent();
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | DisplayTime();
|
| | | WindowCenter.Instance.windowBeforeOpenEvent += OpenWindow;
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | WindowCenter.Instance.windowBeforeOpenEvent -= OpenWindow;
|
| | | }
|
| | |
|
| | |
|
| | | private void SecondEvent()
|
| | | private void OpenWindow(Window win)
|
| | | {
|
| | | if (win.name != typeof(MainInterfaceWin).Name) return;
|
| | |
|
| | | DisplayTime();
|
| | | }
|
| | |
|
| | |
|
| | | void DisplayTime()
|
| | | {
|
| | |
| | | case FlashRushToBuyModel.FlashRushToBuySate.NoOpen:
|
| | | break;
|
| | | case FlashRushToBuyModel.FlashRushToBuySate.InAdvance:
|
| | | if(seconds <= 3600)
|
| | |
|
| | | int saleDay = operation.startDate.day + saleShop.dayIndex;
|
| | | int offsetDay = saleDay - TimeUtility.ServerNow.Day;
|
| | | if(offsetDay > 1)
|
| | | {
|
| | | int split = (3600 - seconds)/30 % 2;
|
| | | if(split == 0)
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy109", TimeUtility.SecondsToMS(seconds));
|
| | | }
|
| | | else
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | }
|
| | | string saleDate = StringUtility.Contact(operation.startDate.month, Language.Get("Month"),saleDay,Language.Get("Day"));
|
| | | timeText.text = saleDate;
|
| | | }
|
| | | else if(offsetDay == 1)
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy110");
|
| | | }
|
| | | else
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | }
|
| | | //if(seconds <= 3600)
|
| | | //{
|
| | | // int split = (3600 - seconds)/30 % 2;
|
| | | // if(split == 0)
|
| | | // {
|
| | | // timeText.text = Language.Get("FlashRushToBuy109", TimeUtility.SecondsToMS(seconds));
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | // }
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | //}
|
| | | break;
|
| | | case FlashRushToBuyModel.FlashRushToBuySate.Begining:
|
| | | timeText.text = Language.Get("FlashRushToBuy107");
|