//-------------------------------------------------------- // [Author]: YYL // [ Date ]: 2025年6月13日 //-------------------------------------------------------- using System.Collections.Generic; using System.IO; using System.Threading; using System; using UnityEngine; using LitJson; public partial class HeroAwakeConfig : ConfigBase { // public int HeroID; // public int AwakeLV; // 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(AwakeLV)) { // 覆盖,防止二次初始化出错 tempDic[AwakeLV] = this; } else { tempDic.Add(AwakeLV, this); } } public static HeroAwakeConfig GetHeroAwakeConfig(int heroID, int awakeLv) { Dictionary tempDic = null; if (!configDics.TryGetValue(heroID, out tempDic)) { return null; } HeroAwakeConfig config = null; tempDic.TryGetValue(awakeLv, out config); return config; } public static bool IsReachMax(int heroID, int awakeLv) { return GetHeroAwakeConfig(heroID, awakeLv) == null; } }