|
@@ -33,7 +33,11 @@ namespace GFGGame
|
|
|
_ui.m_btnExit.onClick.Add(Hide);
|
|
|
_ui.m_btnFightTimes.onClick.Add(StartFight);
|
|
|
}
|
|
|
-
|
|
|
+ protected override void AddEventListener()
|
|
|
+ {
|
|
|
+ EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.STORY_FIGHT_QUICKLY_SUCCESS, StartShowBonus);
|
|
|
+ }
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
@@ -48,20 +52,22 @@ namespace GFGGame
|
|
|
_expAdd = fightCfg.exp;
|
|
|
_power = levelCfg.power;
|
|
|
StartFight();
|
|
|
- EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
|
|
|
- EventAgent.AddEventListener(ConstMessage.STORY_FIGHT_QUICKLY_SUCCESS, StartShowBonus);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
|
Timers.inst.Remove(ShowBonusItem);
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
|
|
|
- EventAgent.RemoveEventListener(ConstMessage.STORY_FIGHT_QUICKLY_SUCCESS, StartShowBonus);
|
|
|
ViewManager.GoBackFrom(typeof(StoryFightQuicklyView).Name);
|
|
|
InstanceZonesDataManager.isQuicklyFighting = false;
|
|
|
|
|
|
}
|
|
|
+ protected override void RemoveEventListener()
|
|
|
+ {
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.STORY_FIGHT_QUICKLY_SUCCESS, StartShowBonus);
|
|
|
+ }
|
|
|
|
|
|
private void StartFight()
|
|
|
{
|
|
@@ -112,11 +118,14 @@ namespace GFGGame
|
|
|
listItem.m_list.ResizeToFit();
|
|
|
listItem.target.height = listItem.m_list.y + listItem.m_list.height;
|
|
|
_index++;
|
|
|
+ UI_StoryFightQuicklyBonusListItem.ProxyEnd();
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
UI_StoryFightQuicklyComplete completeItem = UI_StoryFightQuicklyComplete.Proxy();
|
|
|
_ui.m_list.AddChild(completeItem.target);
|
|
|
+ UI_StoryFightQuicklyComplete.ProxyEnd();
|
|
|
Timers.inst.Remove(ShowBonusItem);
|
|
|
InstanceZonesDataManager.isQuicklyFighting = false;
|
|
|
|