//--------------------------------------------------------  
 | 
//    [Author]:           YYL  
 | 
//    [  Date ]:           2025年8月5日  
 | 
//--------------------------------------------------------  
 | 
  
 | 
using System.Collections.Generic;  
 | 
using System;  
 | 
using UnityEngine;  
 | 
using LitJson;  
 | 
  
 | 
public partial class TaskConfig : ConfigBase<int, TaskConfig>  
 | 
{  
 | 
    static TaskConfig()  
 | 
    {  
 | 
        // 访问过静态构造函数  
 | 
        visit = true;   
 | 
    }  
 | 
  
 | 
    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);  
 | 
        }  
 | 
    }  
 | 
}  
 |