Knaus Irina
Knaus Irina

Reputation: 799

Need a JSON parser for Unity3d

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?

Upvotes: 2

Views: 7700

Answers (2)

Taras Leskiv
Taras Leskiv

Reputation: 1875

You can try one of these open source solutions:

Or go with paid ones:

Upvotes: 2

Programmer
Programmer

Reputation: 125455

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

Upvotes: 2

Related Questions