56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class LocalTextTableData : TableDataBase
|
|
{
|
|
public string s_Korean;
|
|
public string s_English;
|
|
|
|
public string Get_Text()
|
|
{
|
|
// TODO 정인호 : 언어 설정 필요
|
|
return s_Korean;
|
|
}
|
|
}
|
|
|
|
public class table_localtext : table_missionbase
|
|
{
|
|
public static table_localtext Ins;
|
|
List<LocalTextTableData> tableDatas;
|
|
// 선택 언어, id, 텍스트
|
|
Dictionary<int, Dictionary<int, string>> dic_text = new Dictionary<int, Dictionary<int, string>>
|
|
{
|
|
{ 0, new Dictionary<int, string>() }, { 1, new Dictionary<int, string>() },
|
|
};
|
|
|
|
protected override void Awake()
|
|
{
|
|
Ins = this;
|
|
base.Awake();
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<LocalTextTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
dic_text[0].Add(temp.ID, temp.s_Korean);
|
|
dic_text[1].Add(temp.ID, temp.s_English);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public string Get_Text(int id)
|
|
{
|
|
var lang = !DSUtil.CheckNull(OptionInfo.Ins) ? OptionInfo.Ins.m_Language : 0;
|
|
if (dic_text[lang].ContainsKey(id))
|
|
return dic_text[lang][id];
|
|
else
|
|
return DSUtil.Format("No LocalText : {0}", id);
|
|
}
|
|
public List<LocalTextTableData> Get_DataList() { return tableDatas; }
|
|
} |