yyl
2025-09-18 871594462e82d6bc1341918d39e11ab036d59563
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
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
 
public partial class MainLevelConfig : ConfigBase<int, MainLevelConfig>
{
    static Dictionary<int, Dictionary<int, MainLevelConfig>> configDics = new Dictionary<int, Dictionary<int, MainLevelConfig>>();
 
    protected override void OnConfigParseCompleted()
    {
        Dictionary<int, MainLevelConfig> tempDic = null;
        if (!configDics.TryGetValue(ChapterID, out tempDic))
        {
            tempDic = new Dictionary<int, MainLevelConfig>();
            configDics.Add(ChapterID, tempDic);
        }
 
        tempDic[LevelNum] = this;
    }
 
    public static MainLevelConfig GetMainLevelConfig(int chapterID, int LevelNum)
    {
        Dictionary<int, MainLevelConfig> tempDic = null;
        if (!configDics.TryGetValue(chapterID, out tempDic))
        {
            return null;
        }
        MainLevelConfig config = null;
        tempDic.TryGetValue(LevelNum, out config);
        return config;
    }
 
    public static int GetwaveCount(MainLevelConfig config)
    {
        int[][] waveLineupLists = new int[][]
        {
            config.WaveLineupIDList1,
            config.WaveLineupIDList2,
            config.WaveLineupIDList3,
            config.WaveLineupIDList4,
            config.WaveLineupIDList5,
            config.WaveLineupIDList6
        };
 
        // 统计非空数组的数量
        return waveLineupLists.Count(list => list.Length > 0);
    }
 
 
}