using Newtonsoft.Json; using System; using System.Collections.Generic; [Serializable] public class LocalTextTableData : TableDataBase { public int ID; public string s_Korean; public string s_English; public string s_Japan; } public class table_localtext : table_base { public static table_localtext Ins; /// /// 0 한국어, 1 영어, 2 일본어 /// public int m_Language = 0; List tableDatas; // 선택 언어, id, 텍스트 Dictionary> dic_text = new Dictionary> { { 0, new Dictionary() }, { 1, new Dictionary() }, { 2, new Dictionary() }, }; protected override void Awake() { Ins = this; base.Awake(); } protected override void Start() { tableDatas = JsonConvert.DeserializeObject>(json_last); for (int i = 0; i < tableDatas.Count; i++) { var temp = tableDatas[i]; dic_text[0].Add(temp.ID, temp.s_Korean); dic_text[1].Add(temp.ID, temp.s_English); dic_text[2].Add(temp.ID, temp.s_Japan); } base.Start(); } public string Get_Text(int id) { if (dic_text[m_Language].ContainsKey(id)) return dic_text[m_Language][id]; else return DSUtil.Format("No LocalText : {0}", id); } public string Get_Text(int id, params object[] objects) { if (dic_text[m_Language].ContainsKey(id)) return DSUtil.Format(dic_text[m_Language][id], objects); else return DSUtil.Format("No LocalText : {0}", id); } public string Get_StageNodeType(eStageNodeType type) { return Get_Text(10001 + (int)type); } }