| //--------------------------------------------------------  | 
| //    [Author]:           YYL  | 
| //    [  Date ]:           2025年8月5日  | 
| //--------------------------------------------------------  | 
|   | 
| using System.Collections.Generic;  | 
| using System;  | 
| using UnityEngine;  | 
| using LitJson;  | 
|   | 
| public partial class HeroFetterConfig : ConfigBase<int, HeroFetterConfig>  | 
| {  | 
|     static HeroFetterConfig()  | 
|     {  | 
|         // 访问过静态构造函数  | 
|         visit = true;   | 
|     }  | 
|   | 
|     public int FetterID;  | 
|     public string FetterName;  | 
|     public int[] HeroIDList;  | 
|     public int[] AttrIDList;  | 
|     public int[] AttrValueList;  | 
|   | 
|     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 FetterID);   | 
|   | 
|             FetterName = tables[1];  | 
|   | 
|             if (tables[2].Contains("[")) | 
|             { | 
|                 HeroIDList = JsonMapper.ToObject<int[]>(tables[2]); | 
|             } | 
|             else | 
|             { | 
|                 string[] HeroIDListStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 HeroIDList = new int[HeroIDListStringArray.Length]; | 
|                 for (int i=0;i<HeroIDListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(HeroIDListStringArray[i],out HeroIDList[i]); | 
|                 } | 
|             }  | 
|   | 
|             if (tables[3].Contains("[")) | 
|             { | 
|                 AttrIDList = JsonMapper.ToObject<int[]>(tables[3]); | 
|             } | 
|             else | 
|             { | 
|                 string[] AttrIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 AttrIDList = new int[AttrIDListStringArray.Length]; | 
|                 for (int i=0;i<AttrIDListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); | 
|                 } | 
|             }  | 
|   | 
|             if (tables[4].Contains("[")) | 
|             { | 
|                 AttrValueList = JsonMapper.ToObject<int[]>(tables[4]); | 
|             } | 
|             else | 
|             { | 
|                 string[] AttrValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 AttrValueList = new int[AttrValueListStringArray.Length]; | 
|                 for (int i=0;i<AttrValueListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(AttrValueListStringArray[i],out AttrValueList[i]); | 
|                 } | 
|             }  | 
|         }  | 
|         catch (Exception exception)  | 
|         {  | 
|             Debug.LogError(exception);  | 
|         }  | 
|     }  | 
| }  |