//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: 2026年3月13日
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class HeroSkinAttrConfig : ConfigBase<int, HeroSkinAttrConfig>
|
{
|
static HeroSkinAttrConfig()
|
{
|
// 访问过静态构造函数
|
visit = true;
|
}
|
|
public int SkinID;
|
public int Quality;
|
public int NeedItemID;
|
public int StarMax;
|
public int[] WearAttrIDList;
|
public int[] WearAttrValueList;
|
public int[] WearAttrPerStarAddList;
|
public int[] RoleAttrIDList;
|
public int[] RoleAttrValueList;
|
public int[] RoleAttrPerStarAddList;
|
|
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 SkinID);
|
|
int.TryParse(tables[1],out Quality);
|
|
int.TryParse(tables[2],out NeedItemID);
|
|
int.TryParse(tables[3],out StarMax);
|
|
if (tables[4].Contains("["))
|
{
|
WearAttrIDList = JsonMapper.ToObject<int[]>(tables[4]);
|
}
|
else
|
{
|
string[] WearAttrIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
WearAttrIDList = new int[WearAttrIDListStringArray.Length];
|
for (int i=0;i<WearAttrIDListStringArray.Length;i++)
|
{
|
int.TryParse(WearAttrIDListStringArray[i],out WearAttrIDList[i]);
|
}
|
}
|
|
if (tables[5].Contains("["))
|
{
|
WearAttrValueList = JsonMapper.ToObject<int[]>(tables[5]);
|
}
|
else
|
{
|
string[] WearAttrValueListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
WearAttrValueList = new int[WearAttrValueListStringArray.Length];
|
for (int i=0;i<WearAttrValueListStringArray.Length;i++)
|
{
|
int.TryParse(WearAttrValueListStringArray[i],out WearAttrValueList[i]);
|
}
|
}
|
|
if (tables[6].Contains("["))
|
{
|
WearAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[6]);
|
}
|
else
|
{
|
string[] WearAttrPerStarAddListStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
WearAttrPerStarAddList = new int[WearAttrPerStarAddListStringArray.Length];
|
for (int i=0;i<WearAttrPerStarAddListStringArray.Length;i++)
|
{
|
int.TryParse(WearAttrPerStarAddListStringArray[i],out WearAttrPerStarAddList[i]);
|
}
|
}
|
|
if (tables[7].Contains("["))
|
{
|
RoleAttrIDList = JsonMapper.ToObject<int[]>(tables[7]);
|
}
|
else
|
{
|
string[] RoleAttrIDListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
RoleAttrIDList = new int[RoleAttrIDListStringArray.Length];
|
for (int i=0;i<RoleAttrIDListStringArray.Length;i++)
|
{
|
int.TryParse(RoleAttrIDListStringArray[i],out RoleAttrIDList[i]);
|
}
|
}
|
|
if (tables[8].Contains("["))
|
{
|
RoleAttrValueList = JsonMapper.ToObject<int[]>(tables[8]);
|
}
|
else
|
{
|
string[] RoleAttrValueListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
RoleAttrValueList = new int[RoleAttrValueListStringArray.Length];
|
for (int i=0;i<RoleAttrValueListStringArray.Length;i++)
|
{
|
int.TryParse(RoleAttrValueListStringArray[i],out RoleAttrValueList[i]);
|
}
|
}
|
|
if (tables[9].Contains("["))
|
{
|
RoleAttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[9]);
|
}
|
else
|
{
|
string[] RoleAttrPerStarAddListStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
RoleAttrPerStarAddList = new int[RoleAttrPerStarAddListStringArray.Length];
|
for (int i=0;i<RoleAttrPerStarAddListStringArray.Length;i++)
|
{
|
int.TryParse(RoleAttrPerStarAddListStringArray[i],out RoleAttrPerStarAddList[i]);
|
}
|
}
|
}
|
catch (Exception exception)
|
{
|
Debug.LogError(exception);
|
}
|
}
|
}
|