Browse Source

物品获取途径筛选修改

huangxiaoyue 1 year ago
parent
commit
7a0ff7d4bd

+ 9 - 5
GameClient/Assets/Editor/Excel/Scanner/ItemApproachScanner.cs

@@ -372,6 +372,7 @@ namespace GFGEditor
         private static string GetStoryLevelApproach(int itemId)
         private static string GetStoryLevelApproach(int itemId)
         {
         {
             List<string> approachs = new List<string>();
             List<string> approachs = new List<string>();
+            StoryChapterCfg chapterCfg = new StoryChapterCfg();
             StoryLevelCfgArray manager = StoryLevelCfgArray.Instance;
             StoryLevelCfgArray manager = StoryLevelCfgArray.Instance;
             StoryLevelCfg[] dataArray = manager.dataArray;
             StoryLevelCfg[] dataArray = manager.dataArray;
             foreach (StoryLevelCfg cfg in dataArray)
             foreach (StoryLevelCfg cfg in dataArray)
@@ -384,11 +385,14 @@ namespace GFGEditor
                 {
                 {
 
 
                 }
                 }
-                bool result = CheckItemInBonus(itemId, cfg);
-                if (result)
-                {
-                    string approach = "JU_QING_GUAN_QIA=" + cfg.id;
-                    approachs.Add(approach);
+                chapterCfg = StoryChapterCfgArray.Instance.GetCfg(cfg.chapterId);
+                if (chapterCfg != null) {
+                    bool result = CheckItemInBonus(itemId, cfg);
+                    if (result)
+                    {
+                        string approach = "JU_QING_GUAN_QIA=" + cfg.id;
+                        approachs.Add(approach);
+                    }
                 }
                 }
             }
             }
             if (approachs.Count > 0)
             if (approachs.Count > 0)

+ 11 - 9
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -90,15 +90,17 @@ namespace GFGGame
                 if (levelCfg.type == ConstInstanceZonesType.Story)
                 if (levelCfg.type == ConstInstanceZonesType.Story)
                 {
                 {
                     var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId);
                     var chapterCfg = StoryChapterCfgArray.Instance.GetCfg(levelCfg.chapterId);
-                    string chapter = NumberUtil.GetChiniseNumberText(chapterCfg.order);
-                    string level = NumberUtil.GetChiniseNumberText(levelCfg.order);
-                    if (levelCfg.subType == ConstInstanceZonesSubType.Normal)
-                    {
-                        listItem.m_txtSourceName.text = string.Format(gameFunctionCfg.name, chapter, level);
-                    }
-                    else if (levelCfg.subType == ConstInstanceZonesSubType.Hard)
-                    {
-                        listItem.m_txtSourceName.text = string.Format("精英" + gameFunctionCfg.name, chapter, level);
+                    if (chapterCfg != null) { 
+                        string chapter = NumberUtil.GetChiniseNumberText(chapterCfg.order);
+                        string level = NumberUtil.GetChiniseNumberText(levelCfg.order);
+                        if (levelCfg.subType == ConstInstanceZonesSubType.Normal)
+                        {
+                            listItem.m_txtSourceName.text = string.Format(gameFunctionCfg.name, chapter, level);
+                        }
+                        else if (levelCfg.subType == ConstInstanceZonesSubType.Hard)
+                        {
+                            listItem.m_txtSourceName.text = string.Format("精英" + gameFunctionCfg.name, chapter, level);
+                        }
                     }
                     }
                 }
                 }
                 else if (levelCfg.type == ConstInstanceZonesType.Studio)
                 else if (levelCfg.type == ConstInstanceZonesType.Studio)