note: there’s probably a better way to convert the information via branches[key] = jsonnode[branches][key] but I just wanted to post this since there wasn’t really an appropriate answer that doesn’t alter the JSON source.
Keys can’t be arbitrary. They need to be the names of the public variables in the class that you’re serializing.
public class MyClass
{
public string myVar1 = "yo";
}
JSON:
{
"myVar": "yo"
}
It looks like you’re trying to create a 2-dimensional array of strings from the JSON data. I’m not sure if unity supports that in their json, but the class structure would be:
Still haven’t found a way to do this. Workaround: change the JSON structure to avoid dictionary with arbitrary keys. The dictionary mentioned in the question can be changed into: