Unity 3d xml vs json

Hi all,

I have to save files in my unity project. I can save them as an XML files but I also have JSON format in my mind.

Knowing the fact that a JSON file is light weighted than an XML file, are there any downside of using JSON with Unity ?

Thanks

No downside at all no.
Also unity has no XML support. Mono / .NET has XML support and as Unity bases on it you can just use it, but its commonly not exactly recommended unless its a standalone title cause System.XML adds 1.5-2mb in size for webplayer and mobile player. If you are gonna using XML though, look at MiniXML in the boards.

For JSON there are similar good and bad libraries when it comes to the build size, but as with XML, there is a pure open source lightweight parser available on the boards if I recall right :slight_smile:

JSON is a great way to get compact data that can be parsed by json libraries.

http://litjson.sourceforge.net/

This one is pretty straightforward, open source, and works solidly.