| //--------------------------------------------------------  | 
| //    [Author]:           YYL  | 
| //    [  Date ]:           Wednesday, September 17, 2025  | 
| //--------------------------------------------------------  | 
|   | 
| using System.Collections.Generic;  | 
| using System;  | 
| using UnityEngine;  | 
| using LitJson;  | 
|   | 
| public partial class HeroConfig : ConfigBase<int, HeroConfig>  | 
| {  | 
|     static HeroConfig()  | 
|     {  | 
|         // 访问过静态构造函数  | 
|         visit = true;   | 
|     }  | 
|   | 
|     public int HeroID;  | 
|     public string Name;  | 
|     public int PlayerCanUse;  | 
|     public int Country;  | 
|     public int Quality;  | 
|     public int Class;  | 
|     public int Position;  | 
|     public int[] SkinIDList;  | 
|     public int AtkSkillID;  | 
|     public int AngerSkillID;  | 
|     public int AtkInheritPer;  | 
|     public int DefInheritPer;  | 
|     public int HPInheritPer;  | 
|     public Dictionary<int, int> BatAttrDict;  | 
|     public int[] FetterIDList;  | 
|     public float UIScale;  | 
|     public string Desc;  | 
|     public int[] TalentList;  | 
|   | 
|     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 HeroID);   | 
|   | 
|             Name = tables[1];  | 
|   | 
|             int.TryParse(tables[2],out PlayerCanUse);   | 
|   | 
|             int.TryParse(tables[3],out Country);   | 
|   | 
|             int.TryParse(tables[4],out Quality);   | 
|   | 
|             int.TryParse(tables[5],out Class);   | 
|   | 
|             int.TryParse(tables[6],out Position);   | 
|   | 
|             if (tables[7].Contains("[")) | 
|             { | 
|                 SkinIDList = JsonMapper.ToObject<int[]>(tables[7]); | 
|             } | 
|             else | 
|             { | 
|                 string[] SkinIDListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 SkinIDList = new int[SkinIDListStringArray.Length]; | 
|                 for (int i=0;i<SkinIDListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(SkinIDListStringArray[i],out SkinIDList[i]); | 
|                 } | 
|             }  | 
|   | 
|             int.TryParse(tables[8],out AtkSkillID);   | 
|   | 
|             int.TryParse(tables[9],out AngerSkillID);   | 
|   | 
|             int.TryParse(tables[10],out AtkInheritPer);   | 
|   | 
|             int.TryParse(tables[11],out DefInheritPer);   | 
|   | 
|             int.TryParse(tables[12],out HPInheritPer);   | 
|   | 
|             BatAttrDict = ConfigParse.ParseIntDict(tables[13]);   | 
|   | 
|             if (tables[14].Contains("[")) | 
|             { | 
|                 FetterIDList = JsonMapper.ToObject<int[]>(tables[14]); | 
|             } | 
|             else | 
|             { | 
|                 string[] FetterIDListStringArray = tables[14].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 FetterIDList = new int[FetterIDListStringArray.Length]; | 
|                 for (int i=0;i<FetterIDListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(FetterIDListStringArray[i],out FetterIDList[i]); | 
|                 } | 
|             }  | 
|   | 
|             float.TryParse(tables[15],out UIScale);   | 
|   | 
|             Desc = tables[16];  | 
|   | 
|             if (tables[17].Contains("[")) | 
|             { | 
|                 TalentList = JsonMapper.ToObject<int[]>(tables[17]); | 
|             } | 
|             else | 
|             { | 
|                 string[] TalentListStringArray = tables[17].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); | 
|                 TalentList = new int[TalentListStringArray.Length]; | 
|                 for (int i=0;i<TalentListStringArray.Length;i++) | 
|                 { | 
|                      int.TryParse(TalentListStringArray[i],out TalentList[i]); | 
|                 } | 
|             }  | 
|         }  | 
|         catch (Exception exception)  | 
|         {  | 
|             Debug.LogError(exception);  | 
|         }  | 
|     }  | 
| }  |