lcy
2026-04-28 42c8ae5a4fe49c5afdf898da874df55d8d2361cb
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
using System.Collections.Generic;
using UnityEngine;
 
public partial class ActTaskTempConfig : ConfigBase<int, ActTaskTempConfig>
{
    public static Dictionary<int, List<ActTaskTempConfig>> templateIDToConfigsDict = new Dictionary<int, List<ActTaskTempConfig>>();
 
    protected override void OnConfigParseCompleted()
    {
        if (!templateIDToConfigsDict.ContainsKey(TemplateID))
        {
            templateIDToConfigsDict[TemplateID] = new List<ActTaskTempConfig>();
        }
        templateIDToConfigsDict[TemplateID].Add(this);
    }
 
    public static List<ActTaskTempConfig> GetTemplateIDToConfigsDict(int templateID)
    {
        if (templateIDToConfigsDict.ContainsKey(templateID))
        {
            return templateIDToConfigsDict[templateID];
        }
        return null;
    }
 
    // 累计积分奖励配置
    public class TotalScoreAwardConfig
    {
        public int needScore;      // 所需积分
        public int recordIndex;    // 记录索引
        public int itemId;         // 奖励物品ID
        public int itemCount;      // 奖励物品数量
    }
 
    // 通过CfgID获取累计积分奖励列表
    public static List<TotalScoreAwardConfig> GetTotalScoreAwardListByCfgID(int cfgId)
    {
        var result = new List<TotalScoreAwardConfig>();
        var config = ActTaskConfig.Get(cfgId);
        if (config == null || string.IsNullOrEmpty(config.ActScoreAwardInfo) || config.ActScoreAwardInfo == "{}")
        {
            return result;
        }
 
 
        var dict = ConfigParse.ParseIntArrayDict(config.ActScoreAwardInfo);
        foreach (var kvp in dict)
        {
            var arr = kvp.Value;
            if (arr != null && arr.Length >= 3)
            {
                result.Add(new TotalScoreAwardConfig
                {
                    needScore = kvp.Key,
                    recordIndex = arr[0],
                    itemId = arr[1],
                    itemCount = arr[2]
                });
            }
        }
        return result;
    }
}