using Newtonsoft.Json; using System; using System.Collections.Generic; [Serializable] public class FruitTableData : TableDataBase { public int n_FruitID; public int n_STR; public int n_DEX; public int n_INT; public int n_LUK; public string Get_Desc() { var str_STR = table_localtext.Ins.Get_Text(40001); var str_DEX = table_localtext.Ins.Get_Text(40003); var str_INT = table_localtext.Ins.Get_Text(40005); var str_LUK = table_localtext.Ins.Get_Text(40007); if (n_STR > 0 && n_DEX > 0 && n_INT > 0) return DSUtil.Format(314, str_STR, str_DEX, str_INT); else if (n_STR > 0) return DSUtil.Format(315, str_STR); else if (n_DEX > 0) return DSUtil.Format(315, str_DEX); else if (n_INT > 0) return DSUtil.Format(315, str_INT); else if (n_LUK > 0) return DSUtil.Format(315, str_LUK); return ""; } } public class table_fruit : table_missionbase { public static table_fruit Ins; List tableDatas; Dictionary dic_Data = new Dictionary(); protected override void Awake() { base.Awake(); Ins = this; } protected override void Start() { tableDatas = JsonConvert.DeserializeObject>(json_last); for (int i = 0; i < Get_DataList().Count; i++) { var temp = Get_DataList()[i]; dic_Data.Add(temp.n_FruitID, temp); } base.Start(); } public FruitTableData Get_Data_orNull(int id) { return dic_Data[id]; } public List Get_DataList() { return tableDatas; } }