Hi. I know this subject has been asked a billion times, but I searched and tried everything I saw and can’t seem to get it done. Maybe help on my specific case could enlighten me.
I have this json file (created outside c# and much longer)
{"0":{"game":[0,0,0,0,0,0,0,0,0],"result":[1,0,0,0]},"1":{"game":[0,0,0,0,0,0,0,0,1],"result":[1,0,0,0]},"2":{"game":[0,0,0,0,0,0,0,0,2],"result":[0,0,0,1]},"3":{"game":[0,0,0,0,0,0,0,1,0],"result":[1,0,0,0]},"4":{"game":[0,0,0,0,0,0,0,1,1],"result":[0,0,0,1]},"5":{"game":[0,0,0,0,0,0,0,1,2],"result":[1,0,0,0]},"6":{"game":[0,0,0,0,0,0,0,2,0],"result":[0,0,0,1]}}
This is somewhat of an array with arrays inside (with keys of course).
I have these classes to help me deserialize it (which to me seem to be the type of data I’m trying to get).
public class who_cares : MonoBehaviour {
void Start () {
// Not pertinent stuff before
Tics results = JsonUtility.FromJson<Tics>(theJson);
}
}
[System.Serializable]
public class Tics {
public Games[] values;
}
[System.Serializable]
public class Games {
public float[] game;
public float[] result;
}
Somehow, it doesn’t implode nor stop execution, but just returns null. Im completely lost and have been trying and searching for hours. Thank you for anyone who dares help.