瀏覽代碼

主线优化

zhaoyang 3 年之前
父節點
當前提交
cc5df72fdb

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryCardChoose.cs

@@ -91,6 +91,8 @@ namespace GFGGame
                 SceneController.AddObjectToView(null, null, item.m_holder, resPath, out gameObject0, out wrapper0);
                 _effects.Add(gameObject0);
             }
+            UI_ListCardItem.ProxyEnd();
+            UI_ComStar.ProxyEnd();
         }
         private void OnListCardItemClick(EventContext context)
         {

+ 2 - 4
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -119,6 +119,7 @@ namespace GFGGame
             listItem.target.data = chapterCfg.id;
             listItem.m_content.target.data = chapterCfg.id;
             RedDotController.Instance.SetComRedDot(listItem.m_content.target, RedDotDataManager.Instance.GetChapterRed(chapterCfg.id), "", 0, (int)listItem.m_content.m_txtProgress.y - 20);
+            UI_ListChapterItem.ProxyEnd();
         }
 
         private void UpdateList()
@@ -160,10 +161,7 @@ namespace GFGGame
                         }
                     }
                 }
-                if (i == 0)
-                {
-                    // GuideController.TryGuideByGuideId(listItem.m_content.target, ConstGuideId.MAIN_UI_BTN_STORY, 1, true, "点击章节图标,继续探索吧");
-                }
+                UI_ListChapterItem.ProxyEnd();
             }
         }
 

+ 10 - 4
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -57,10 +57,12 @@ namespace GFGGame
             {
                 OnClickBonusBox(_ui.m_bonusBox3, 2);
             });
-            EventAgent.AddEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
 
         }
-
+        protected override void AddEventListener()
+        {
+            EventAgent.AddEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
+        }
         protected override void OnShown()
         {
             base.OnShown();
@@ -85,10 +87,12 @@ namespace GFGGame
             _endLevelItem = null;
             _ui.m_chapter.RemoveChildren(0, 0, true);
             _valueBarController.OnHide();
-            EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
-
         }
 
+        protected override void RemoveEventListener()
+        {
+            EventAgent.RemoveEventListener(ConstMessage.NOTICE_MAINSTORY_BOXBONUS_STATE, UpdateBonusBox);
+        }
         private void OnClickBtnBack()
         {
             ViewManager.GoBackFrom(ViewName.STORY_CHAPTER_VIEW);
@@ -174,6 +178,7 @@ namespace GFGGame
                     {
                         levelItem.target.visible = false;
                     }
+                    UI_CompStoryLevelItem.ProxyEnd();
                 }
             }
             if (_endLevelItem != null)
@@ -192,6 +197,7 @@ namespace GFGGame
 
             UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(context.sender as GObject);
             int levelCfgId = (int)levelItem.target.data;
+            UI_CompStoryLevelItem.ProxyEnd();
             StoryController.ShowLevelView(levelCfgId);
         }
 

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -157,7 +157,7 @@ namespace GFGGame
 
         private void OnClickBtnLookBack()
         {
-            if(_ui.m_btnSkip.enabled)
+            if (_ui.m_btnSkip.enabled)
             {
                 ViewManager.Show(ViewName.STORY_LOOK_BACK_VIEW, _stroyStartID);
             }
@@ -181,6 +181,7 @@ namespace GFGGame
             {
                 stepID = "0";
             }
+            UI_ListDialogItem.ProxyEnd();
             OnStepComplete(stepID);
         }
 
@@ -316,6 +317,7 @@ namespace GFGGame
                 UI_ListDialogItem dialogItem = UI_ListDialogItem.Proxy(item);
                 dialogItem.m_txtContent.text = itemInfoList[0];
                 dialogItem.target.data = itemInfoList.Length > 1 ? itemInfoList[1] : null;
+                UI_ListDialogItem.ProxyEnd();
             };
             _ui.m_list.numItems = list.Length;
 

+ 14 - 5
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightQuicklyView.cs

@@ -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;
 

+ 9 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -50,13 +50,15 @@ namespace GFGGame
             AddEffect();
 
         }
-
+        protected override void AddEventListener()
+        {
+            EventAgent.AddEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
+        }
         protected override void OnShown()
         {
             base.OnShown();
             if (_sceneObject == null) _sceneObject = GameObject.Instantiate(_scenePrefab);
             SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject);
-            EventAgent.AddEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
 
             _gameObject2.SetActive(false);
             _ui.m_comClickCircle.target.onClick.Add(CircleScoreEnd);
@@ -207,6 +209,7 @@ namespace GFGGame
             comScoreResult.m_txtCount2.text = count.ToString();
             ET.Log.Debug("count:" + count);
             _score += ScoreSystemData.Instance.GetPartScore(partId, clickState, _mainScore, _skillScore);
+            UI_ComScoreResult.ProxyEnd();
         }
 
         private void CircleResuleEnd()
@@ -320,10 +323,13 @@ namespace GFGGame
             Reset();
             InstanceZonesController.OnFinishStoryLevel(InstanceZonesDataManager.currentLevelCfgId, false, false);
         }
+        protected override void RemoveEventListener()
+        {
+            EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
+        }
         private void Reset()
         {
             _stopFight = true;
-            EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
             Timers.inst.Remove(SkillScoreStart);
             Timers.inst.Remove(Skip);
             _ui.m_comAllCircle.target.visible = false;

+ 5 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs

@@ -131,6 +131,7 @@ namespace GFGGame
                 GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
                 UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(btnSkill);
                 SceneController.AddObjectToView(null, null, item.m_holder, resPath3, out GameObject _gameObject, out GoWrapper _wrapper);
+                UI_ComBtnSkill.ProxyEnd();
                 _gameObjects.Add(_gameObject);
             }
 
@@ -263,6 +264,7 @@ namespace GFGGame
                 GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
                 UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(btnSkill);
                 item.m_txtCount.text = roleSkillCfgs[i].limiteCount.ToString();
+                UI_ComBtnSkill.ProxyEnd();
                 btnSkill.touchable = true;
                 if (_isAutoPlay)
                 {
@@ -438,7 +440,7 @@ namespace GFGGame
             item.m_c1.selectedIndex = 1;
             item.m_icon.data = count + 1;
             item.m_txtCount.text = (cfg.limiteCount - (count + 1)).ToString();
-
+            UI_ComBtnSkill.ProxyEnd();
             SetCdState(obj, cfg.cd);
             SetSkillValue(cfg, SkillDataManager.MINE);
         }
@@ -461,8 +463,10 @@ namespace GFGGame
                   {
                       OnBtnSkillClick(item1.target);
                   }
+                  UI_ComBtnSkill.ProxyEnd();
 
               });
+            UI_ComBtnSkill.ProxyEnd();
         }
 
         private void SetSkillValue(RoleSkillCfg cfg, int role)

+ 9 - 6
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs

@@ -37,7 +37,10 @@ namespace GFGGame
 
             _ui.m_listTag.itemRenderer = RenderListTagItem;
         }
-
+        protected override void AddEventListener()
+        {
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
+        }
         protected override void OnShown()
         {
             base.OnShown();
@@ -50,18 +53,17 @@ namespace GFGGame
             _ui.m_btnStart.touchable = true;
             UpdateView();
 
-
-
-            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
             ViewManager.SetMaskAlpha(0.6f);
+        }
+        protected override void RemoveEventListener()
+        {
             EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
-
         private void OnClickBtnStart()
         {
             // int time = InstanceZonesDataManager.GetCanFightTime(_levelID);
@@ -178,7 +180,7 @@ namespace GFGGame
             (item.data as ItemView).SetData(itemData);
             List<ItemData> bonusOnceData = StoryBonusDataCache.GetBonusData(_levelID).bonusOnce;
             (item.data as ItemView).LoaShouTongRewardVisble = !InstanceZonesDataManager.CheckLevelPass(_levelID) && index < bonusOnceData.Count;
-
+            UI_ComItem.ProxyEnd();
         }
 
         private void UpdateBtnFightTimes()
@@ -292,6 +294,7 @@ namespace GFGGame
             string[] tag = fightCfg.needTagsArr[index].Split('_');
             item.m_loaTag.url = ResPathUtil.GetCommonGameResPath("fzd_bqbq_" + tag[0]);
             item.m_txtTag.text = tag[1];
+            UI_ListTagItem.ProxyEnd();
         }