Browse Source

主线自动滚动到当前位置

zhaoyang 2 years ago
parent
commit
28bd1cfb26

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -143,6 +143,7 @@ namespace GFGGame
         {
             _chapterCfgs = StoryChapterCfgArray.Instance.GetCfgsBysubType(subType);
             _ui.m_listChapter.numItems = _chapterCfgs.Count;
+            int currentChapterIndex = 0;
             for (int i = 0; i < _ui.m_listChapter.numChildren; i++)
             {
                 UI_ListChapterItem listItem = UI_ListChapterItem.Proxy(_ui.m_listChapter.GetChildAt(i));
@@ -155,6 +156,7 @@ namespace GFGGame
                 {
                     listItem.m_content.m_imgLockBg.visible = false;
                     listItem.m_content.m_txtLockDesc.visible = false;
+                    currentChapterIndex = i;
                 }
                 else
                 {
@@ -179,6 +181,7 @@ namespace GFGGame
                 }
                 UI_ListChapterItem.ProxyEnd();
             }
+            _ui.m_listChapter.ScrollToView(currentChapterIndex);
         }
         private void CheckGuide(object param)
         {