Переглянути джерело

飞花令相关战斗添加判空处理

zhangyuqian 1 рік тому
батько
коміт
24341066a6

+ 24 - 6
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetScoreView.cs

@@ -249,6 +249,7 @@ namespace GFGGame
                     }
                     Dictionary<int, Dictionary<int ,List<PassivitySkillLvlCfg>>> dic = new Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>>();
                     Dictionary<int, List<PassivitySkillLvlCfg>> dic1 = new Dictionary<int, List<PassivitySkillLvlCfg>>();
+                    List<PassivitySkillLvlCfg> passlist = new List<PassivitySkillLvlCfg>();
                     //vaildSkills = ArenaDataManager.Instance.vaildSkills[ArenaDataManager.Instance.CurFightIndex][_partId][_currentTime];
                     ArenaDataManager.Instance.vaildSkills.TryGetValue(ArenaDataManager.Instance.CurFightIndex, out dic);
                     if (dic != null)
@@ -256,16 +257,24 @@ namespace GFGGame
                         dic.TryGetValue(_partId, out dic1);
                         if (dic1 != null)
                         {
-                            vaildSkills = dic1[_currentTime];
+                            dic1.TryGetValue(_currentTime,out passlist);
+                            if(passlist != null)
+                            {
+                                vaildSkills = passlist;
+                            }
+                            else
+                            {
+                                Debug.LogError($"_currentTime {_currentTime}");
+                            }
                         }
                         else
                         {
-                            Debug.LogError($"258_partId {_partId}");
+                            Debug.LogError($"_partId {_partId}");
                         }
                     }
                     else
                     {
-                        Debug.LogError($"263CurFightIndex {ArenaDataManager.Instance.CurFightIndex}");
+                        Debug.LogError($"CurFightIndex {ArenaDataManager.Instance.CurFightIndex}");
                     }
                 }
                 else
@@ -288,22 +297,31 @@ namespace GFGGame
                     }
                     Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>> dic = new Dictionary<int, Dictionary<int, List<PassivitySkillLvlCfg>>>();
                     Dictionary<int, List<PassivitySkillLvlCfg>> dic1 = new Dictionary<int, List<PassivitySkillLvlCfg>>();
+                    List<PassivitySkillLvlCfg> passlist = new List<PassivitySkillLvlCfg>();
                     ArenaDataManager.Instance.targetVaildSkills.TryGetValue(ArenaDataManager.Instance.CurFightIndex, out dic);
                     if (dic != null)
                     {
                         dic.TryGetValue(_partId,out dic1);
                         if(dic1 != null)
                         {
-                            vaildSkills = dic1[_currentTime];
+                            dic1.TryGetValue(_currentTime, out passlist);
+                            if (passlist != null)
+                            {
+                                vaildSkills = passlist;
+                            }
+                            else
+                            {
+                                Debug.LogError($"target_currentTime {_currentTime}");
+                            }
                         }
                         else
                         {
-                            Debug.LogError($"291_partId {_partId}");
+                            Debug.LogError($"target_partId {_partId}");
                         }
                     }
                     else
                     {
-                        Debug.LogError($"296CurFightIndex {ArenaDataManager.Instance.CurFightIndex}");
+                        Debug.LogError($"target_CurFightIndex {ArenaDataManager.Instance.CurFightIndex}");
                     }
                     //vaildSkills = ArenaDataManager.Instance.targetVaildSkills[ArenaDataManager.Instance.CurFightIndex][_partId][_currentTime];
                 }