//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: 2025年11月16日
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class HorseClassConfig : ConfigBase<int, HorseClassConfig>
|
{
|
static HorseClassConfig()
|
{
|
// 访问过静态构造函数
|
visit = true;
|
}
|
|
public int ClassLV;
|
public int MaxLV;
|
public int LVUPItemCnt;
|
public int ClassUPItemCnt;
|
public int[] ClassSpecAttrIDList;
|
public int[] ClassSpecAttrValueList;
|
public int[] AttrIDList;
|
public int[] ClassAttrValueList;
|
public int[] PerLVAttrValueList;
|
|
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 ClassLV);
|
|
int.TryParse(tables[1],out MaxLV);
|
|
int.TryParse(tables[2],out LVUPItemCnt);
|
|
int.TryParse(tables[3],out ClassUPItemCnt);
|
|
if (tables[4].Contains("["))
|
{
|
ClassSpecAttrIDList = JsonMapper.ToObject<int[]>(tables[4]);
|
}
|
else
|
{
|
string[] ClassSpecAttrIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
ClassSpecAttrIDList = new int[ClassSpecAttrIDListStringArray.Length];
|
for (int i=0;i<ClassSpecAttrIDListStringArray.Length;i++)
|
{
|
int.TryParse(ClassSpecAttrIDListStringArray[i],out ClassSpecAttrIDList[i]);
|
}
|
}
|
|
if (tables[5].Contains("["))
|
{
|
ClassSpecAttrValueList = JsonMapper.ToObject<int[]>(tables[5]);
|
}
|
else
|
{
|
string[] ClassSpecAttrValueListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
ClassSpecAttrValueList = new int[ClassSpecAttrValueListStringArray.Length];
|
for (int i=0;i<ClassSpecAttrValueListStringArray.Length;i++)
|
{
|
int.TryParse(ClassSpecAttrValueListStringArray[i],out ClassSpecAttrValueList[i]);
|
}
|
}
|
|
if (tables[6].Contains("["))
|
{
|
AttrIDList = JsonMapper.ToObject<int[]>(tables[6]);
|
}
|
else
|
{
|
string[] AttrIDListStringArray = tables[6].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[7].Contains("["))
|
{
|
ClassAttrValueList = JsonMapper.ToObject<int[]>(tables[7]);
|
}
|
else
|
{
|
string[] ClassAttrValueListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
ClassAttrValueList = new int[ClassAttrValueListStringArray.Length];
|
for (int i=0;i<ClassAttrValueListStringArray.Length;i++)
|
{
|
int.TryParse(ClassAttrValueListStringArray[i],out ClassAttrValueList[i]);
|
}
|
}
|
|
if (tables[8].Contains("["))
|
{
|
PerLVAttrValueList = JsonMapper.ToObject<int[]>(tables[8]);
|
}
|
else
|
{
|
string[] PerLVAttrValueListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
PerLVAttrValueList = new int[PerLVAttrValueListStringArray.Length];
|
for (int i=0;i<PerLVAttrValueListStringArray.Length;i++)
|
{
|
int.TryParse(PerLVAttrValueListStringArray[i],out PerLVAttrValueList[i]);
|
}
|
}
|
}
|
catch (Exception exception)
|
{
|
Debug.LogError(exception);
|
}
|
}
|
}
|