1.Excel 配表轉(zhuǎn)換成 Json文件以及數(shù)據(jù)結(jié)構(gòu)代碼。
? ?https://github.com/huangkumao/ConfigTools

2.Json文件讀取到對(duì)應(yīng)到數(shù)據(jù)結(jié)構(gòu)中。
? ? ?https://github.com/SaladLab/Json.Net.Unity3D
? ? ?CfgEditorPetList是配置表,會(huì)生成對(duì)應(yīng)名字的類和Json文件。解析代碼如下。
? ? 代碼:
? ?? string path = Application.dataPath + "/Json/CfgEditorPetList.json";
? ? ?string content = File.ReadAllText(path);
? ? ? CfgEditorPetList t = JsonConvert.DeserializeObject< CfgEditorPetList>(content);