|
@@ -133,7 +133,11 @@ namespace GFGGame
|
|
|
|
|
|
LuckyBoxDataManager.Instance.currentBoxId = boxId;
|
|
LuckyBoxDataManager.Instance.currentBoxId = boxId;
|
|
|
|
|
|
- if (_activeBoxId > 0 || boxId == LuckyBoxDataManager.BOX_ID_2) Timers.inst.Add(1, 0, CheckTime);
|
|
|
|
|
|
+ bool actLimitTsyOpen = LuckyBoxDataManager.Instance.GetActLimitTsyOpen();
|
|
|
|
+ if (LuckyBoxDataManager.Instance.currentBoxId == _activeBoxId)
|
|
|
|
+ Timers.inst.Add(1, 0, CheckTime);
|
|
|
|
+ else if (actLimitTsyOpen && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
+ Timers.inst.Add(1, 0, UpdateTime);
|
|
|
|
|
|
_valueBarController.OnShown();
|
|
_valueBarController.OnShown();
|
|
_valueBarController.Controller(4);
|
|
_valueBarController.Controller(4);
|
|
@@ -462,55 +466,47 @@ namespace GFGGame
|
|
|
|
|
|
private void CheckTime(object param = null)
|
|
private void CheckTime(object param = null)
|
|
{
|
|
{
|
|
- if (LuckyBoxDataManager.Instance.currentBoxId == _activeBoxId)
|
|
|
|
- {
|
|
|
|
- if (LuckyBoxDataManager.Instance.currentBoxId != _activeBoxId) return;
|
|
|
|
- long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
|
|
- long curTime = TimeHelper.ServerNow();
|
|
|
|
- TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
|
|
|
+ if (LuckyBoxDataManager.Instance.currentBoxId != _activeBoxId) return;
|
|
|
|
+ long endTime = LuckyBoxDataManager.Instance.endTime;
|
|
|
|
+ long curTime = TimeHelper.ServerNow();
|
|
|
|
+ TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
|
|
|
- GObject item = _ui.m_listBg.GetChildAt(0);
|
|
|
|
- if (item == null) return;
|
|
|
|
- GObject textField = item.asCom.GetChild("txtTime");
|
|
|
|
- if (textField == null) return;
|
|
|
|
-
|
|
|
|
- long time = endTime - curTime;
|
|
|
|
- string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
|
|
- textField.asTextField.text = string.Format("概率提升:剩余{0}", strTime);
|
|
|
|
- }
|
|
|
|
- else if(LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_2)
|
|
|
|
- {
|
|
|
|
- GObject item = _ui.m_listBg.GetChildAt(1);
|
|
|
|
- if (item == null) return;
|
|
|
|
- GObject textField = item.asCom.GetChild("txtTsyTime");
|
|
|
|
- if (textField == null) return;
|
|
|
|
- int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
|
- var activityCfg = ActivityOpenCfgArray.Instance.GetCfg(activityId);
|
|
|
|
- long endTime = 0;
|
|
|
|
- if(activityCfg != null)
|
|
|
|
- endTime = TimeUtil.DateTimeToTimestamp(activityCfg.endTime);
|
|
|
|
- long curTime = TimeHelper.ServerNow();
|
|
|
|
- if (endTime < curTime)
|
|
|
|
- {
|
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
|
- Timers.inst.Remove(UpdateTime);
|
|
|
|
- OnClickBtnBack();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
|
- textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
|
|
|
+ GObject item = _ui.m_listBg.GetChildAt(0);
|
|
|
|
+ if (item == null) return;
|
|
|
|
+ GObject textField = item.asCom.GetChild("txtTime");
|
|
|
|
+ if (textField == null) return;
|
|
|
|
|
|
- //=====限时礼包倒计时
|
|
|
|
- //UpGiftBox();
|
|
|
|
- //EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_TIME);
|
|
|
|
- //=====限时礼包倒计时END
|
|
|
|
- }
|
|
|
|
|
|
+ long time = endTime - curTime;
|
|
|
|
+ string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
|
|
+ textField.asTextField.text = string.Format("概率提升:剩余{0}", strTime);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
private void UpdateTime(object param = null)
|
|
private void UpdateTime(object param = null)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ GObject item = _ui.m_listBg.GetChildAt(1);
|
|
|
|
+ if (item == null) return;
|
|
|
|
+ GObject textField = item.asCom.GetChild("txtTsyTime");
|
|
|
|
+ if (textField == null) return;
|
|
|
|
+ int activityId = ActivityDataManager.Instance.GetCurOpenActiveByType(ConstLimitTimeActivityType.ActLimitTsy);
|
|
|
|
+ var activityCfg = ActivityOpenCfgArray.Instance.GetCfg(activityId);
|
|
|
|
+ long endTime = 0;
|
|
|
|
+ if (activityCfg != null)
|
|
|
|
+ endTime = TimeUtil.DateTimeToTimestamp(activityCfg.endTime);
|
|
|
|
+ long curTime = TimeHelper.ServerNow();
|
|
|
|
+ if (endTime < curTime)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("活动已结束");
|
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
|
|
+ endTime = curTime;
|
|
|
|
+ //OnClickBtnBack();
|
|
|
|
+ }
|
|
|
|
+ TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
|
+ textField.asTextField.text = "概率提升剩余: " + TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
|
+
|
|
|
|
+ //=====限时礼包倒计时
|
|
|
|
+ //UpGiftBox();
|
|
|
|
+ //EventAgent.DispatchEvent(ConstMessage.LUCKY_BOX_TIME);
|
|
|
|
+ //=====限时礼包倒计时END
|
|
}
|
|
}
|
|
|
|
|
|
private void updateBoxEffect()
|
|
private void updateBoxEffect()
|
|
@@ -607,9 +603,9 @@ namespace GFGGame
|
|
|
|
|
|
Timers.inst.Remove(OnTimerUpdate);
|
|
Timers.inst.Remove(OnTimerUpdate);
|
|
Timers.inst.Remove(CheckTime);
|
|
Timers.inst.Remove(CheckTime);
|
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
// Timers.inst.Remove(UpdateBg);
|
|
// Timers.inst.Remove(UpdateBg);
|
|
Timers.inst.Remove(CheckGuide);
|
|
Timers.inst.Remove(CheckGuide);
|
|
- // Timers.inst.Remove(UpdateTime);
|
|
|
|
Debug.Log("OnHide: LuckyBoxView");
|
|
Debug.Log("OnHide: LuckyBoxView");
|
|
}
|
|
}
|
|
|
|
|