yyl
2025-06-17 007fbd542c30f5fa8308128aac26ce6584b3067a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//--------------------------------------------------------
//    [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<int, HeroAwakeConfig>
{
    // public int HeroID;
    // public int AwakeLV;
 
    // HeroID, Dictionary<AwakeLV, HeroAwakeConfig>
    public static Dictionary<int, Dictionary<int, HeroAwakeConfig>> configDics = new Dictionary<int, Dictionary<int, HeroAwakeConfig>>();
 
    protected override void OnConfigParseCompleted()
    {
        base.OnConfigParseCompleted();
 
        Dictionary<int, HeroAwakeConfig> tempDic = null;
 
        if (!configDics.TryGetValue(HeroID, out tempDic))
        {
            tempDic = new Dictionary<int, HeroAwakeConfig>();
            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<int, HeroAwakeConfig> 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;
    }
}