zhaoyang пре 3 година
родитељ
комит
87ef85c452

+ 12 - 0
GameClient/Assets/Game/HotUpdate/Data/FunctionOpenDataManager.cs

@@ -1,4 +1,5 @@
 using ET;
+using FairyGUI;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -50,9 +51,12 @@ namespace GFGGame
             }
             if (listCfg.Count > 0)
             {
+                // Timers.inst.Add(1, 0, FunctionOpen, listCfg);
                 ViewManager.Show<FunctionOpenView>(listCfg);
+
             }
         }
+
         /// <summary>
         /// 根据角色Lv检测是否有新功能开启
         /// </summary>
@@ -69,10 +73,18 @@ namespace GFGGame
             }
             if (listCfg.Count > 0)
             {
+                // Timers.inst.Add(1, 0, FunctionOpen, listCfg);
                 ViewManager.Show<FunctionOpenView>(listCfg);
             }
         }
 
+        // private void FunctionOpen(object param)
+        // {
+        //     if (ViewManager.isViewOpen(typeof(RoleLvUpView).Name)) return;
+        //     ViewManager.Show<FunctionOpenView>(param);
+        //     Timers.inst.Remove(FunctionOpen);
+
+        // }
 
         //检测配置章节是否开启
         private bool CheckIsChapterFunOpen(FunctionOpenCfg cfg, bool showTips = true)

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -114,6 +114,8 @@ namespace GFGGame
         }
         private static void CheckUpLv(object param)
         {
+            if (ViewManager.isViewOpen(typeof(FunctionOpenView).Name)) return;
+
             if (GRoot.inst.GetTopWindow() == null)
             {
                 OpenRoleLvUpView(null);

+ 7 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/InstanceZonesSProxy.cs

@@ -58,7 +58,7 @@ namespace GFGGame
                 NpcScore = npcScore,
                 UseRecommend = false
             });
-            bool ifFirstFinish = false;
+            bool isFirstFinish = false;
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
@@ -79,7 +79,7 @@ namespace GFGGame
 
                     if (response.HasOnceBonus)
                     {
-                        ifFirstFinish = true;
+                        isFirstFinish = true;
                     }
                     InstanceZonesDataManager.TrySetLevelPass(response.LevelCfgId);
                     ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
@@ -90,11 +90,15 @@ namespace GFGGame
                         Star = response.Star,
                         BonusList = bonusList
                     }, null, true);
+                    if (response.HasOnceBonus)
+                    {
+                        FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(response.LevelCfgId);
+                    }
                     return;
                 }
             }
             InstanceZonesController.OnFinishStoryLevel(levelCfgId, false, false);
-            if (ifFirstFinish)
+            if (isFirstFinish)
             {
                 //首次通过要检查是否有功能开启
                 FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(response.LevelCfgId);

+ 15 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryController.cs

@@ -25,7 +25,7 @@ namespace GFGGame
 
         public static void OnFinishStoryLevel(int levelCfgId, bool firstPass, bool success)
         {
-            if(success)
+            if (success)
             {
                 //判断是否是首次打通最后一关
                 int nextLevelID = levelCfgId + 1;
@@ -34,6 +34,20 @@ namespace GFGGame
 
                 if (fistPassLastLvl)
                 {
+                    StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelCfgId);
+                    StoryChapterCfg nextStoryChapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId + 1);
+                    if (nextStoryChapterCfg != null)
+                    {
+                        StoryLevelCfg nextChapterLevelCfg = StoryLevelCfgArray.Instance.GetCfgs(nextStoryChapterCfg.type, nextStoryChapterCfg.subType, nextStoryChapterCfg.id)[0];
+
+                        int LevelID = nextChapterLevelCfg.id;
+                        MainStoryDataManager.currentLevelCfgId = LevelID;
+                    }
+                    else
+                    {
+                        MainStoryDataManager.currentLevelCfgId = 0;
+
+                    }
                     ViewManager.Show(ViewName.STORY_CHAPTER_LIST_VIEW, null, null, true);
                 }
                 else

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -246,6 +246,7 @@ namespace GFGGame
             {
                 if (viewName != excludeViewName)
                 {
+                    if (viewName == typeof(FunctionOpenView).Name) continue;//功能开启界面不能强制关闭
                     Hide(viewName);
                 }
             }