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