//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: 2025年6月16日
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Threading;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class HeroConfig : ConfigBase<int, HeroConfig>
|
{
|
|
public int HeroID;
|
public int Country;
|
public int Quality;
|
public int[] SkinNPCIDList;
|
public int AtkSkillID;
|
public int AngerSkillID;
|
public int AtkInheritPer;
|
public int DefInheritPer;
|
public int HPInheritPer;
|
public string BatAttrDict;
|
public int[] FetterIDList;
|
|
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);
|
|
int.TryParse(tables[1],out Country);
|
|
int.TryParse(tables[2],out Quality);
|
|
if (tables[3].Contains("["))
|
{
|
SkinNPCIDList = JsonMapper.ToObject<int[]>(tables[3]);
|
}
|
else
|
{
|
string[] SkinNPCIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
SkinNPCIDList = new int[SkinNPCIDListStringArray.Length];
|
for (int i=0;i<SkinNPCIDListStringArray.Length;i++)
|
{
|
int.TryParse(SkinNPCIDListStringArray[i],out SkinNPCIDList[i]);
|
}
|
}
|
|
int.TryParse(tables[4],out AtkSkillID);
|
|
int.TryParse(tables[5],out AngerSkillID);
|
|
int.TryParse(tables[6],out AtkInheritPer);
|
|
int.TryParse(tables[7],out DefInheritPer);
|
|
int.TryParse(tables[8],out HPInheritPer);
|
|
BatAttrDict = tables[9];
|
|
if (tables[10].Contains("["))
|
{
|
FetterIDList = JsonMapper.ToObject<int[]>(tables[10]);
|
}
|
else
|
{
|
string[] FetterIDListStringArray = tables[10].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]);
|
}
|
}
|
}
|
catch (Exception exception)
|
{
|
Debug.LogError(exception);
|
}
|
}
|
}
|