Hello!
How can I retrieve a nested object in Unity with JsonUtility.
I have something like this in javascript:
grid = {
type: "frame",
layer_1: { "height": 100, "numberOfComponents": 3 },
layer_2: { "height": 200, "numberOfComponents": 7 },
};
UNITY_INSTANCE.SendMessage('Landscape', 'SetGrid', JSON.stringify(grid));
and in Unity:
[HideInInspector]
public string type;
public void SetGrid(string data)
{
JsonUtility.FromJsonOverwrite(data, this);
Debug.Log(type); //frame
So type works but how to get
layer_1['height']
↧