瀏覽代碼

剧情章节最后一关判空处理

zhangyuqian 1 年之前
父節點
當前提交
1a5b4d2421

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -233,7 +233,8 @@ namespace GFGGame
             int lineGap = 4500 / list.Count;
 
             StoryLevelCfg lastLevelCfg = list[list.Count - 1];
-            if (lastLevelCfg != null && MainStoryDataManager.CheckLevelUnlock(lastLevelCfg.id))
+            StoryChapterCfg LastChapterCfg = StoryChapterCfgArray.Instance.GetCfg(_chapterID + 1);
+            if (lastLevelCfg != null && MainStoryDataManager.CheckLevelUnlock(lastLevelCfg.id) && LastChapterCfg != null)
             {
                 _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
             }

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

@@ -37,7 +37,17 @@ namespace GFGGame
                     {
                         index = 1;
                     }
-                    ViewManager.Show<StoryChapterListView>(new object[] { index , nextStoryChapterCfg.order}, null, true);
+                    //当副本表内最后一章通关时 
+                    if (nextStoryChapterCfg == null)
+                    {
+                        StoryChapterCfg lastChapter = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId);
+                        ViewManager.Show<StoryChapterListView>(new object[] { index, lastChapter.order - 1 }, null, true);
+                    }
+                    else
+                    {
+                        ViewManager.Show<StoryChapterListView>(new object[] { index , nextStoryChapterCfg.order}, null, true);
+                    }
+                    
                 }
                 else
                 {