yyl
7 小时以前 0b15db60b38265335e97f934fdcfe21f164504af
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
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Friday, June 27, 2025
//--------------------------------------------------------
 
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System;
using UnityEngine;
using LitJson;
 
public partial class AppointItemConfig : ConfigBase<int, AppointItemConfig>
{
 
    public int ID;
    public int[] LegendAttrID;
    public int[] LegendAttrValue;
 
    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 ID); 
 
            if (tables[1].Contains("["))
            {
                LegendAttrID = JsonMapper.ToObject<int[]>(tables[1]);
            }
            else
            {
                string[] LegendAttrIDStringArray = tables[1].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LegendAttrID = new int[LegendAttrIDStringArray.Length];
                for (int i=0;i<LegendAttrIDStringArray.Length;i++)
                {
                     int.TryParse(LegendAttrIDStringArray[i],out LegendAttrID[i]);
                }
            }
 
            if (tables[2].Contains("["))
            {
                LegendAttrValue = JsonMapper.ToObject<int[]>(tables[2]);
            }
            else
            {
                string[] LegendAttrValueStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                LegendAttrValue = new int[LegendAttrValueStringArray.Length];
                for (int i=0;i<LegendAttrValueStringArray.Length;i++)
                {
                     int.TryParse(LegendAttrValueStringArray[i],out LegendAttrValue[i]);
                }
            }
        }
        catch (Exception exception)
        {
            Debug.LogError(exception);
        }
    }
}