using CodeStage.AntiCheat.ObscuredTypes; using MiniJSON; using System.Collections; using System.Collections.Generic; using UnityEngine; public class ChapterTextTableData : TableDataBase { public string NameWithNum, ChapterName, ShortName, Desc; public ObscuredInt ChapterQuestClearRewardAmount; } public class table_chaptertext : MonoBehaviour { public static table_chaptertext Ins; public TextAsset m_json; private List list_Data = new List(); private void Awake() { Ins = this; Dictionary jsonData = Json.Deserialize(m_json.text) as Dictionary; // ["items"]은 items.txt 안의 items를 가리킨다. 툴 우측 하단 파일 종류란에서 설정 가능. List obj = jsonData[GetType().Name] as List; foreach (object objt in obj) { var temp = new ChapterTextTableData(); Dictionary json = objt as Dictionary; temp.ID = int.Parse(json["Chapter"].ToString()); temp.NameWithNum = json["NameWithNum"].ToString(); temp.ChapterName = json["ChapterName"].ToString(); temp.ShortName = json["ShortName"].ToString(); temp.Desc = json["Desc"].ToString(); temp.ChapterQuestClearRewardAmount = int.Parse(json["ChapterQuestClearRewardAmount"].ToString()); list_Data.Add(temp); } } public List Get_DataList(bool _memory = false) { if (_memory) return list_Data.FindAll(f => f.ID > 100); return list_Data.FindAll(f => f.ID > 0 && f.ID < 100); } public ChapterTextTableData Get_Data(int _chapter) { return list_Data.Find(f => f.ID == _chapter) as ChapterTextTableData; } }