dll文件:在unity中创建Plugis文件夹并导入Litjson.dll到文件夹下

命名空间:

using System.IO;
using LitJson;
using System.Data;

代码:

string testJsonFilePath = “文件路径+文件名”;
string jsonContext = File.ReadAllText(testJsonFilePath);
QuestionBank questionBank= JsonMapper.ToObject<与JSON文件对应的类>(jsonContext);

//文件内容存储在questionBank中

更多推荐