//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: 2025年11月6日
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class SuccessConfig : ConfigBase<int, SuccessConfig>
|
{
|
static SuccessConfig()
|
{
|
// 访问过静态构造函数
|
visit = true;
|
}
|
|
public int ID;
|
public int Type;
|
public int NeedCnt;
|
public int[] Condition;
|
public int[][] AwardItemList;
|
|
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 ID);
|
|
int.TryParse(tables[1],out Type);
|
|
int.TryParse(tables[2],out NeedCnt);
|
|
if (tables[3].Contains("["))
|
{
|
Condition = JsonMapper.ToObject<int[]>(tables[3]);
|
}
|
else
|
{
|
string[] ConditionStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
Condition = new int[ConditionStringArray.Length];
|
for (int i=0;i<ConditionStringArray.Length;i++)
|
{
|
int.TryParse(ConditionStringArray[i],out Condition[i]);
|
}
|
}
|
|
AwardItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]"));
|
}
|
catch (Exception exception)
|
{
|
Debug.LogError(exception);
|
}
|
}
|
}
|