- Home /
Looking for Code that will Read JSON files (C# code)
I am looking for code in C# that will allow my unity game to read and use data from a JSON file. This will be used to create and edit objects in my game. I have been advised to use JsonFX but I haven't been able to find a C# version of this. I should add that I am new to coding so I would love any advice/explanations. Thanks!!
I use LitJSON, which works fine on phones etc. I understand JsonFX is better but never found a decent Unity version, though I think it does/did exist.
There's stuff on the Asset Store too if you have some cash.
Answer by ArkaneX · Jun 18, 2013 at 08:36 PM
You can try SimpleJSON at Unity wiki. According to the description it reads data better than writes it, but it looks like you need reading only.
As a side note - I don't know what kind of data is stored in the file you're going to read, but despite the fact that JSON is a 'standard', it's good to do some tests. Just to be sure that parser can properly work with that data.
Answer by Olly · May 02, 2016 at 07:10 PM
Use the JsonUtiliy to parse objects directly. Don't use SimpleJson it's horrible (And not simple)