- Home /
C# JSON library
I am developing an app using Unity3D for desktop web browsers.
There are many .NET/C# JSON libraries listed on http://www.json.org/
What is the best C# JSON library to use in Unity3D?
Thanks in advance for your help
Answer by pion · Sep 08, 2011 at 12:06 AM
I found JSON Object C#-based library on Unity Asset Store.
It is free.
I have not used it.
Answer by blueddarker · Jan 17, 2015 at 05:08 AM
Check this unity asset : https://www.assetstore.unity3d.com/#!/content/18457
Answer by angelusiones · Sep 19, 2015 at 03:32 AM
@pion2 Use this https://github.com/AngelQuirogaM/NiceJson
mod
I've updated it to support Escaping/Unescaping strings like it must do. I have seen no more problems far from that.
Thanks to @Bunny83
It looks much better now, but it looks like it still does not unescape strings, does it? ^^
Also have you run some benchmarking in regards to garbage generation? You seem to create many new string instances. For large files your "splitting" into seperate strings can easily produce garbage that has multiple times the actual json string size.
Apart from that it looks ok now, though i haven't tested it myself. Currently i'm not that active in development ^^.
Thanks for helping me (also without being active in development ;) ). You were right, i wasn't unescaping it . But now it does. I have also put the solidus escaping opcion if someones need it. I would search to optimize it like you told me.
Answer by Xarbrough · Sep 20, 2015 at 12:19 AM
I use LitJson and am happy with it. I especially wanted to write "pretty" json files which are formatted in an easy to read and editable way. Not sure which other libraries have this functionality, but after testing two, I found LitJson to look good.
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Json return 405 status code when posting 1 Answer
How to write a json tree? 1 Answer
Doesn't JsonUtility support arrays with abstract type? 1 Answer