Browse Source

合成副本补充提交

zhangyuqian 1 year ago
parent
commit
0f5e590c38

+ 22 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/TimeTracingSProxy.cs

@@ -78,6 +78,28 @@ namespace GFGGame
             }
             return true;
         }
+        //获取指定关卡评分奖励状态
+        public static async ETTask<bool> ReqGetAppointLevelRewardStatus(int levelID)
+        {
+            Dictionary<int, int> rewardData = null;
+            S2C_GetInstanceZonesRatingRewardList response = null;
+                    rewardData = new Dictionary<int, int>();
+                    response = (S2C_GetInstanceZonesRatingRewardList)await MessageHelper.SendToServer(new C2S_GetInstanceZonesRatingRewardList { StoryLevelId = levelID });
+                    if (!(response is { Error: ErrorCode.ERR_Success })) return false;
+                    for (int j = 0; j < response.RewardKs.Count; j++)
+                    {
+                        rewardData.Add(response.RewardKs[j], response.RewardVs[j]);
+                    }
+                    if (TimeTracingDataManager.LevelRewardDic.ContainsKey(levelID))
+                    {
+                        TimeTracingDataManager.LevelRewardDic[levelID] = rewardData;
+                    }
+                    else
+                    {
+                        TimeTracingDataManager.LevelRewardDic.Add(levelID, rewardData);
+                    }
+            return true;
+        }
         //领取条积分奖励
         public static async ETTask<bool> ReqGetLevelReward(int levelId ,int rewardId)
         {

+ 13 - 1
GameClient/Assets/Game/HotUpdate/Views/ActivityThemeLuckyBox/ActivityThemeLuckyBoxView.cs

@@ -37,7 +37,7 @@ namespace GFGGame
             _ui.m_btnChapter.target.onClick.Add(OnBtnChapterClick);
             _ui.m_btnLuckyBox.target.onClick.Add(OnBtnLuckyBoxClick);
             _ui.m_btnShop.target.onClick.Add(OnBtnShopClick);
-
+            PreloadSuitModel();
         }
 
         protected override void AddEventListener()
@@ -210,5 +210,17 @@ namespace GFGGame
                 _effectUIDic.Add("R", EffectUIPool.CreateEffectUI(_ui.m_btnChapter.m_effectHolder, "ui_Activity", "SYJH_icon_tx_R"));
             }
         }
+        private void PreloadSuitModel()
+        {
+            int[] suitIDList = ActivityOpenCfgArray.Instance.GetCfg(2).params2Arr;
+            for (int i = 0; i < suitIDList.Length; i++)
+            {
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitIDList[i]);
+                ResType resType = ResType.Sprite;
+                if (suitCfg.aniRes != "")
+                    resType = ResType.Animation;
+                PreDownloadManager.Instance.PreDownloadSuitRes(suitIDList[i], resType, new int[] { ConstDressUpItemType.BEI_JING }, true);
+            }
+        }
     }
 }

+ 13 - 0
GameClient/Assets/Game/HotUpdate/Views/InstanceZones/InstanceZonesView.cs

@@ -58,6 +58,7 @@ namespace GFGGame
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hzs_bg");
             _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_bg_eff, "ui_HaiZhiShi", "Bg_All_Tx");
             _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_fish_eff, "ui_HaiZhiShi", "Bg_Yu");
+            PreloadSuitModel();
         }
 
         protected override void OnShown()
@@ -183,6 +184,18 @@ namespace GFGGame
             GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER_5, 1, "", -1, false);
             GuideController.TryGuide(_ui.m_btnField.target, "TimeTracingShowView", 3, "合成副本可获得奖励和服装哦~");
         }
+        private void PreloadSuitModel()
+        {
+            List<int> suitIdList = new List<int>() { 201030, 201010, 202006 };
+            for (int i = 1; i < suitIdList.Count; i++)
+            {
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitIdList[i]);
+                ResType resType = ResType.Sprite;
+                if (suitCfg.aniRes != "")
+                    resType = ResType.Animation;
+                PreDownloadManager.Instance.PreDownloadSuitRes(suitIdList[i], resType, new int[] { ConstDressUpItemType.BEI_JING }, false);
+            }
+        }
 
     }
 }

+ 10 - 9
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -98,7 +98,7 @@ namespace GFGGame
             _effectUI10 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_proExp.m_comHolder.m_holder, "ui_fight_new", "ZDJS_jindu_tx");
             _effectUI11 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_holderHead, "ui_fight_new", "ZDJS_player");
         }
-        protected override void OnShown()
+        protected async override void OnShown()
         {
             base.OnShown();
             _resultData = (StoryFightResultData)this.viewData;
@@ -140,9 +140,17 @@ namespace GFGGame
                 Timers.inst.Add(3, 1, OnClickBtnClose);
             }
             _ui.m_comResult.m_t0.Play(AddExp);
+
+            StoryLevelCfg storylevel = StoryLevelCfgArray.Instance.GetCfg(MainStoryDataManager.currentLevelCfgId);
+            if (_resultData.Result && storylevel.type == 6 && storylevel.subType == 2)
+            {
+                //await TimeTracingSProxy.ReqGetMaxLevelInfo(TimeTracingDataManager._currentChapterId);
+                await TimeTracingSProxy.ReqGetAppointLevelRewardStatus(TimeTracingDataManager._currentChapterId);
+                await TimeTracingSProxy.ReqGetSuitRewardStatus();
+            }
         }
 
-        protected async override void OnHide()
+        protected override void OnHide()
         {
             base.OnHide();
 
@@ -166,13 +174,6 @@ namespace GFGGame
             }
             else
             {
-                StoryLevelCfg storylevel = StoryLevelCfgArray.Instance.GetCfg(MainStoryDataManager.currentLevelCfgId);
-                if (storylevel.type == 6 && storylevel.subType == 2)
-                {
-                    await TimeTracingSProxy.ReqGetMaxLevelInfo(TimeTracingDataManager._currentChapterId);
-                    await TimeTracingSProxy.ReqGetLevelRewardStatus();
-                    await TimeTracingSProxy.ReqGetSuitRewardStatus();
-                }
                 InstanceZonesController.OnFinishStoryLevel(InstanceZonesDataManager.currentLevelCfgId, _resultData.FirstPass, true);
                 //尝试显示奖励
                 BonusController.TryShowBonusList(_resultData.BonusList);

+ 0 - 8
GameClient/Assets/Game/HotUpdate/Views/TimeTracing/TimeTracingShowView.cs

@@ -33,14 +33,6 @@ namespace GFGGame
             _ui.m_makeSuitBtn.target.onClick.Add(OnClickMakeSuitBtn);
             _ui.m_switchBtn.target.onClick.Add(OnClickSwitchBtn);
             _ui.m_ruleBtn.onClick.Add(RuleController.ShowRuleView);
-            //预加载套装,对于不同suitid
-            for (int i = 1; i < suitIdList.Count; i++)
-            {
-                if (true)
-                {
-                    PreDownloadManager.Instance.PreDownloadSuitRes(suitIdList[i], ResType.Both, new int[] { ConstDressUpItemType.BEI_JING }, false);
-                }
-            }
         }
         protected override void AddEventListener()
         {