【发布时间】:2016-04-14 09:58:53
【问题描述】:
我需要反序列化一些 JSON 对象。我尝试使用 Tiny-json 库,但它太慢了。我尝试使用 Newtonsoft.Json,但在 webplayer 中失败并出现以下错误:
MissingMethodException: Method not found: 'System.Collections.ObjectModel.KeyedCollection.
你推荐什么 JSON 解析器?
【问题讨论】:
我需要反序列化一些 JSON 对象。我尝试使用 Tiny-json 库,但它太慢了。我尝试使用 Newtonsoft.Json,但在 webplayer 中失败并出现以下错误:
MissingMethodException: Method not found: 'System.Collections.ObjectModel.KeyedCollection.
你推荐什么 JSON 解析器?
【问题讨论】:
您可以尝试以下开源解决方案之一:
或者选择付费的:
【讨论】:
Unity 5.3 添加了对 Json Serializer 的 Native 支持。它比其他人更快。
JsonUtility.ToJson 将类转换为 Json。
JsonUtility.FromJson 将 Json 转换回类。
有关 json 数组的完整示例和信息,请参阅
【讨论】: