yyl
2 天以前 973edc44a04dceb8b48a32ca912e6167f86189d4
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
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Thursday, August 21, 2025
//--------------------------------------------------------
 
using System.Collections.Generic;
using System;
using UnityEngine;
using LitJson;
 
public partial class EffectConfig : ConfigBase<int, EffectConfig>
{
    static EffectConfig()
    {
        // 访问过静态构造函数
        visit = true; 
    }
 
    public int id;
    public string packageName;
    public int isSpine;
    public string fxName;
    public int[] animIndex;
    public int audio;
    public string nodeName;
    public int notShow;
    public int autoDestroy;
    public float destroyDelay;
    public int isLoop;
    public int frontBack;
    public float delayPlay;
 
    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); 
 
            packageName = tables[1];
 
            int.TryParse(tables[2],out isSpine); 
 
            fxName = tables[3];
 
            if (tables[4].Contains("["))
            {
                animIndex = JsonMapper.ToObject<int[]>(tables[4]);
            }
            else
            {
                string[] animIndexStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
                animIndex = new int[animIndexStringArray.Length];
                for (int i=0;i<animIndexStringArray.Length;i++)
                {
                     int.TryParse(animIndexStringArray[i],out animIndex[i]);
                }
            }
 
            int.TryParse(tables[5],out audio); 
 
            nodeName = tables[6];
 
            int.TryParse(tables[7],out notShow); 
 
            int.TryParse(tables[8],out autoDestroy); 
 
            float.TryParse(tables[9],out destroyDelay); 
 
            int.TryParse(tables[10],out isLoop); 
 
            int.TryParse(tables[11],out frontBack); 
 
            float.TryParse(tables[12],out delayPlay); 
        }
        catch (Exception exception)
        {
            Debug.LogError(exception);
        }
    }
}