hch
11 小时以前 a6cbc1f71e0bb1b6dd2159e1be22234f5d95630e
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           2026年2月7日
//--------------------------------------------------------
 
using System.Collections.Generic;
using System;
using UnityEngine;
using LitJson;
 
public partial class TimingGiftConfig : ConfigBase<int, TimingGiftConfig>
{
    static TimingGiftConfig()
    {
        // 访问过静态构造函数
        visit = true; 
    }
 
    public int GiftID;
    public string GiftName;
    public int GiftType;
    public int[] CTGIDs;
    public int[] TopColor;
    public int[] BottomColor;
    public int[] OutlineColor;
 
    public override int LoadKey(string _key)
    {
        int key = GetKey(_key);
        return key;
    }
 
    public override void LoadConfig(string input)
    {
        try {
        string[] tables = input.Split('\t');
        int.TryParse(tables[0],out GiftID); 
 
            GiftName = tables[1];
 
            int.TryParse(tables[2],out GiftType); 
 
            if (tables[3].Contains("["))
            {
                CTGIDs = JsonMapper.ToObject<int[]>(tables[3]);
            }
            else
            {
                string[] CTGIDsStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                CTGIDs = new int[CTGIDsStringArray.Length];
                for (int i=0;i<CTGIDsStringArray.Length;i++)
                {
                     int.TryParse(CTGIDsStringArray[i],out CTGIDs[i]);
                }
            }
 
            if (tables[4].Contains("["))
            {
                TopColor = JsonMapper.ToObject<int[]>(tables[4]);
            }
            else
            {
                string[] TopColorStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                TopColor = new int[TopColorStringArray.Length];
                for (int i=0;i<TopColorStringArray.Length;i++)
                {
                     int.TryParse(TopColorStringArray[i],out TopColor[i]);
                }
            }
 
            if (tables[5].Contains("["))
            {
                BottomColor = JsonMapper.ToObject<int[]>(tables[5]);
            }
            else
            {
                string[] BottomColorStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                BottomColor = new int[BottomColorStringArray.Length];
                for (int i=0;i<BottomColorStringArray.Length;i++)
                {
                     int.TryParse(BottomColorStringArray[i],out BottomColor[i]);
                }
            }
 
            if (tables[6].Contains("["))
            {
                OutlineColor = JsonMapper.ToObject<int[]>(tables[6]);
            }
            else
            {
                string[] OutlineColorStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                OutlineColor = new int[OutlineColorStringArray.Length];
                for (int i=0;i<OutlineColorStringArray.Length;i++)
                {
                     int.TryParse(OutlineColorStringArray[i],out OutlineColor[i]);
                }
            }
        }
        catch (Exception exception)
        {
            Debug.LogError(exception);
        }
    }
}