unity配置工具

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);

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。