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