I want to write a custom JsonConverter to read JSON files into an Dictionary Object.
It would be something like:
file.json -> Dictionary<string, MyObject>
file.json:
{
"dictKey" : "stringValue with HELLO", ...
}
where MyObject is a class with a few values like:
string textValue;
bool HasHELLO;
Any idea how one would achieve this?
I'm trying to do this on Unity 5.3, so the NET version is limited to 3.5 (mostly).
Something like this, but obviously this wouldn't work unless I override the Jsonconverter and write my own:
Dictionary<string, MyObject> values = JsonConvert.DeserializeObject<Dictionary<string, MyObject>>(json);