3.Json文件格式-Excel转Json
3.1 知识点
主要学习内容
Excel中配置数据
Excel数据转Json数据
直接复制excel表到网页上,点击转换
把刚刚转换后的信息赋值到json文件里
以后会用脚本或者编辑器工具,就不用每次都去网页上转换了
总结
3.2 知识点代码
[
{"hp":4,"speed":6,"volume":5,"resName":"Airplane/Airplane1","scale":15},
{"hp":3,"speed":7,"volume":4,"resName":"Airplane/Airplane2","scale":15},
{"hp":2,"speed":8,"volume":3,"resName":"Airplane/Airplane3","scale":15},
{"hp":10,"speed":3,"volume":10,"resName":"Airplane/Airplane4","scale":6},
{"hp":6,"speed":5,"volume":7,"resName":"Airplane/Airplane5","scale":10}
]
3.3 练习题
请把Unity入门中的炮台数据转换在Excel表中配置,转换为Json数据,存储到一个Json文件中
编写excel,复制到网页转换,转换工具转换的结果可能会出现问题,要注意检查
新建json文件,把转换结果复制过去
3.4 练习题代码
[
{"id":1,"type":1,"num":5,"cd":0.8,"ids":"1,10","delay":8},
{"id":2,"type":2,"num":5,"cd":0,"ids":"11,20","delay":10},
{"id":3,"type":2,"num":8,"cd":0.5,"ids":"1,20","delay":5},
{"id":4,"type":1,"num":10,"cd":0.5,"ids":"5,15","delay":10}
]
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 785293209@qq.com