Selaa lähdekoodia

优化主界面启动流程,缩短时间

guodong 1 vuosi sitten
vanhempi
commit
114d4ec64f

+ 12 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -50,6 +50,18 @@ namespace GFGGame
                 AdCfgArray.Instance.Init();
                 ItemTypeCfgArray.Instance.Init();
                 GuideCfgArray.Instance.Init();
+                SuitCfgArray.Instance.Init();
+                ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY);
+                SuitFosterCfgArray.Instance.Init();
+                VipCfgArray.Instance.Init();
+                ActivityRechargeCfgArray.Instance.Init();
+                ActivityLuckybonusCfgArray.Instance.Init();
+                Activity7DaysTaskCfgArray.Instance.Init();
+                Activity7DaysCfgArray.Instance.Init();
+                SuitGuideMenuCfgArray.Instance.Init();
+                ActivityRecharge2CfgArray.Instance.Init();
+                SuitFosterListCfgArray.Instance.Init();
+
                 //显示登录
                 LoginController.ShowLogin();
             });

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -252,7 +252,7 @@ namespace GFGGame
             ViewManager.Hide<LoginView>();
             ViewManager.Show<LoadingView>();
             LoadingView.Instance.SetProgress(99);
-            LoadingView.Instance.SetDesc("正在进入游戏");
+            LoadingView.Instance.SetDesc("正在加载数据...");
             LogServerHelper.SendNodeLog((int)LogNode.StartEnterGame);
             errorCode = await LoginHelper.EnterGame(GameGlobal.zoneScene);
             if (errorCode != ErrorCode.ERR_Success)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -201,7 +201,7 @@ namespace GFGGame
                 //LogHelper.LogEditor($"ItemDataManager InitServerData {roleItem.ConfigId}");
                 Add(roleItem);
             }
-            //DressUpMenuItemDataManager.StartPreLoadItemCfg();
+            DressUpMenuItemDataManager.StartPreLoadItemCfg();
             //_ = DressUpMenuItemDataManager.GetAllDressUpGuideIdListBySubTypeAsync();
 
         }

+ 12 - 3
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -39,6 +39,8 @@ namespace GFGGame
         private List<EffectUI> _effectUIList = new List<EffectUI>();
         private UI_ButtonModle1[] _btns;
         private bool firstIn;
+        //用于标记自动检测打开界面流程已执行完毕
+        private bool AutoShowCompleted;
 
         public override void Dispose()
         {
@@ -190,6 +192,7 @@ namespace GFGGame
             Timers.inst.AddUpdate(Update);
             Update(null);
 
+            //让主界面先显示出来,其他逐步处理
             Timers.inst.Remove(OnShowLater);
             Timers.inst.Add(0.1f, 1, OnShowLater);
 
@@ -219,6 +222,7 @@ namespace GFGGame
             Timers.inst.Remove(CheckGuide);
             Timers.inst.Remove(UpdateAdListTime);
             Timers.inst.Remove(OnShowLater);
+            Timers.inst.Remove(OnRedDotChangedLater);
         }
 
         private void OnShowLater(object param)
@@ -836,7 +840,12 @@ namespace GFGGame
 
         private void OnRedDotChanged()
         {
-            Timers.inst.CallLater(OnRedDotChangedLater);
+            //暂时用这种方法优化下,红点的实现要重构!!!
+            //LogHelper.LogEditor("MainUIView UpdateRedDot OnRedDotChanged");
+            if (!GameGlobal.AfterDataInited) return;
+            if (!AutoShowCompleted) return;
+            Timers.inst.Remove(OnRedDotChangedLater);
+            Timers.inst.Add(0.1f, 1, OnRedDotChangedLater);
         }
 
         private void OnRedDotChangedLater(object o)
@@ -846,8 +855,6 @@ namespace GFGGame
 
         private void UpdateRedDot()
         {
-            return;
-            if (firstIn) return;
             LogHelper.LogEditor("MainUIView UpdateRedDot");
             _valueBarController.UpRead();
             RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed(), "", -9, 12);
@@ -1021,6 +1028,8 @@ namespace GFGGame
                 ViewManager.Show<FieldFightEndView>();
                 return;
             }
+            AutoShowCompleted = true;
+            OnRedDotChanged();
         }
 
     }