- Home /
JSON in Unity JavaScript
Is there a way to parse JSON purely in Unity JavaScript?
Answer by Mike 3 · Apr 30, 2011 at 03:35 AM
You can use the LitJSON library from javascript just fine:
It should work for iOS, and does it matter what it's coded in? It's an assembly you include, no need to look at the source. You also use the .NET assemblies which are all coded in c#
how do you actually get litjson or a .net library in general to work with unity?
You just drag the dll file into your project, and use it as if it were code (i.e. as the litjson documentation will tell you to use it)
Answer by artman · Oct 12, 2011 at 03:19 AM
Much easier would be:
var decoded:Object = eval(jsonString);
I don't think so. Also, using eval to parse json is bad practice for security reasons, even in a real javascript environment.