Hi,
I finally got my scene to save and load from mysql → php → javascript → unity3d (what a nightmare).
now I need to process the data I have saved and I choose to use the json format which is very webbrowser javascript friendly and easy to manage with php and very easy to save in mysql… now I have the json data sent from a html(javascript) to unity and need to process the json format in unity… and the nightmare continues here.
I stumbled upon a type called Boo.Lang.Hash and could see it would actually create key/pairs from my json format… which is almost what I wanted… of course my json format has a mix of key/pairs and arrays in it… but I expected that I could just create a new Boo.Lang.Hash for each key that was an array.
To make this more clearer, here is an example of the json I want to parse:
[
{
"title":"Air Landing Mat 240x400x95",
"xp":"-16.41544",
"yp":"3.644961E-16",
"zp":"45.30033",
"xr":"270",
"yr":"90",
"zr":"0"
},
{
"title":"ProTrack M 210x1200",
"xp":"-3.97962",
"yp":"8.836547E-17",
"zp":"28.33701",
"xr":"270",
"yr":"90",
"zr":"0"
}
]
I kinda expedt that I could do the following:
for ( key in j.Keys )
{
var jj : Boo.Lang.Hash = eval(j[key]);
title = jj["title"];
}
but of course this doesn’t work… why? I have no clue… the amazing documentation about Boo.Lang.Hash and how to use it with Unity3d script is impossible to find.
can somebody help me here?
Peter