|
@@ -41,7 +41,11 @@ namespace GFGGame
|
|
|
_ui.m_btnLuckyBox.onClick.Add(OnBtnLuckyBoxClick);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ protected override void AddEventListener()
|
|
|
+ {
|
|
|
+ base.AddEventListener();
|
|
|
+ EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
|
|
|
+ }
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
@@ -54,6 +58,7 @@ namespace GFGGame
|
|
|
_activityCfg = ActivityOpenCfgArray.Instance.GetCfg(_activityId);
|
|
|
_luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(_activityCfg.paramsArr[0]);
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hb_" + _activityCfg.res);
|
|
|
+ UpdateRedDot();
|
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
|
}
|
|
|
protected override void OnHide()
|
|
@@ -61,7 +66,11 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
}
|
|
|
-
|
|
|
+ protected override void RemoveEventListener()
|
|
|
+ {
|
|
|
+ base.RemoveEventListener();
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
|
|
|
+ }
|
|
|
private void OnBtnBackClick()
|
|
|
{
|
|
|
ViewManager.GoBackFrom(typeof(ActivityThemeLuckyBoxView).FullName);
|
|
@@ -90,5 +99,9 @@ namespace GFGGame
|
|
|
TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
|
|
|
_ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
|
|
|
}
|
|
|
+ private void UpdateRedDot()
|
|
|
+ {
|
|
|
+ RedDotController.Instance.SetComRedDot(_ui.m_btnLuckyBox, RedDotDataManager.Instance.GetActLuckyBoxRewardRed(), "", -90, 70);
|
|
|
+ }
|
|
|
}
|
|
|
}
|