hey everyone! - i’m having a bit of trouble on the deserializing front. here’s the basic array format in text file. note that my code doesn’t contain the indents or line breaks - i assume that’s not important? i’m breaking it up here so you can see the basic structure:
{
"SavedLayer":[
{
"layerName":"Layer_0",
"instrumentNumber":0,
"seqLength":7,
"timeDivision":8,
"gateTime":0.30000001192092898,
"noteRowAssign":[30,42,44,46,47,59,63,80]
},
{"layerName":"Layer_1",
"instrumentNumber":1,
"seqLength":8,
"timeDivision":16,
"gateTime":0.30000001192092898,
"noteRowAssign":[40,42,43,44,46,48,49,51]
},
]
}
i’m trying to retrieve it like this:
string AllTheData=File.ReadAllText(filename);
SavedLayer[] data=JsonHelper.getJsonArray<SavedLayer>(AllTheData);
Debug.Log(data[0]);
SavedLayer is the basic class i created to store each object’s data in JSON. it validates in JSON Lint as well. however if i try to get the first object in the array using this method, i get ‘unexpected node type’ and a Null Ref on the Debug.Log statement.
any clue what i’m doing wrong here?