Hello, im new with Unity and also new at C# and i can´t find a solution for this:
I have a static public class to keep the data between scenes:
public static class loginData {
public static string idUser;
public static string email;
public static string nick; }
i have this JSON
{“status”:“ok”,
“estat”:[{“idUser”:“2”,“nick”:“dude”,“email”:“dude”}],
“weapons”:[{“idWeapon”:“1”,“state”:“1000”,“codeWeapon”:“1”}],
“complements”:null
}
then i parse Json data:
var N = JSON.Parse(w.text);
loginData.idUser=N["estat"][0]["idUser"];
and the problem is how can I put the array “Weapons” on the static class loginData to be persistent beteen scenes?
beacause i tryed :
public static JSONNode armes;
armes=N["weapons"];
but when i try to access it from another script/scene,
loginScript.weapons.Length
it says it doenst have a definition for Length.
In resume, public static JSONNode armes; doesnt keep the array static, i can acces the array from same script, but not from others.
thanks for help, and sorry for my english.