需要导入??Newtonsoft.Json;
1:
2:
3:将需要转换的 txt 文件拖入?Resources 文件夹下?
4:创建转换的实体类?
5:
public List<ResultMsgEntity> resultMsgList;
private TextAsset jsonText; //存储的json 文件
protected override void Awake()
{
base.Awake();
jsonText = Resources.Load("text/ResultJson") as TextAsset;
resultMsgList = JsonConvert.DeserializeObject<List<ResultMsgEntity>>(jsonText.ToString());
}