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