//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: Friday, June 27, 2025
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Threading;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class TaskConfig : ConfigBase<int, TaskConfig>
|
{
|
|
public int TaskID;
|
public int Index;
|
public int TaskType;
|
public int[] TaskConds;
|
public int NeedValue;
|
public string TaskDescribe;
|
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 TaskID);
|
|
int.TryParse(tables[1],out Index);
|
|
int.TryParse(tables[2],out TaskType);
|
|
if (tables[3].Contains("["))
|
{
|
TaskConds = JsonMapper.ToObject<int[]>(tables[3]);
|
}
|
else
|
{
|
string[] TaskCondsStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
|
TaskConds = new int[TaskCondsStringArray.Length];
|
for (int i=0;i<TaskCondsStringArray.Length;i++)
|
{
|
int.TryParse(TaskCondsStringArray[i],out TaskConds[i]);
|
}
|
}
|
|
int.TryParse(tables[4],out NeedValue);
|
|
TaskDescribe = tables[5];
|
|
AwardItemList = JsonMapper.ToObject<int[][]>(tables[6].Replace("(", "[").Replace(")", "]"));
|
}
|
catch (Exception exception)
|
{
|
Debug.LogError(exception);
|
}
|
}
|
}
|