using System.Collections.Generic; using UnityEngine; public partial class HeroBreakConfig : ConfigBase { // public int HeroID; // public int BreakLV; // HeroID, Dictionary public static Dictionary> configDics = new Dictionary>(); protected override void OnConfigParseCompleted() { base.OnConfigParseCompleted(); Dictionary tempDic = null; if (!configDics.TryGetValue(HeroID, out tempDic)) { tempDic = new Dictionary(); configDics.Add(HeroID, tempDic); } if (tempDic.ContainsKey(BreakLV)) { tempDic[BreakLV] = this; } else { tempDic.Add(BreakLV, this); } } public static HeroBreakConfig GetHeroBreakConfig(int heroID, int breakLv) { Dictionary tempDic = null; if (!configDics.TryGetValue(heroID, out tempDic)) { return null; } HeroBreakConfig config = null; tempDic.TryGetValue(breakLv, out config); return config; } public static bool IsReachMax(int heroID, int breakLv) { return GetHeroBreakConfig(heroID, breakLv) == null; } }