Unity3D

unity配置工具

2020-02-29  本文已影响0人  言之有物行之有理

1.Excel 配表转换成 Json文件以及数据结构代码。

   https://github.com/huangkumao/ConfigTools

2.Json文件读取到对应到数据结构中。

     https://github.com/SaladLab/Json.Net.Unity3D

     CfgEditorPetList是配置表,会生成对应名字的类和Json文件。解析代码如下。

    代码:

     string path = Application.dataPath + "/Json/CfgEditorPetList.json";

     string content = File.ReadAllText(path);

      CfgEditorPetList t = JsonConvert.DeserializeObject< CfgEditorPetList>(content);

上一篇 下一篇

猜你喜欢

热点阅读