Need a JSON parser for Unity3d

2020-04-16 06:07发布

I need to deserialize some JSON objects. I tried to use Tiny-json library, but it's too slow. I tried to use Newtonsoft.Json, but it fails in webplayer with this error:

MissingMethodException: Method not found: 'System.Collections.ObjectModel.KeyedCollection.

What JSON parser do you recommend?

标签: json unity3d
2条回答
Melony?
2楼-- · 2020-04-16 06:20

Unity 5.3 added Native support of Json Serializer. It is faster than others.

JsonUtility.ToJson to convert a class to Json.

JsonUtility.FromJson to convert Json back to class.

For complete example and information regarding json arrays, see

Serialize and Deserialize Json and Json Array in Unity

查看更多
相关推荐>>
3楼-- · 2020-04-16 06:36

You can try one of these open source solutions:

Or go with paid ones:

查看更多
登录 后发表回答