i'm trying to change a JSONNode into a Dictionnary. I've been searching for hours for a solution. I know that JsonUtilities doesn't work with Dictionaries. Everything I try gives test4 = null
with no errors.
JSONNode test1 = JSON.Parse(customData);
//customData is :"{\"ItemClass\":\"S\",\"Type\":\"Band\",\"Stats\":[{\"HP\":\"100\",\"Atk\":\"50\",\"Def\":\"25\",\"Crit\":\"10\"}]}"
JSONArray test2 = test1["Stats"].AsArray;
JSONNode test3 = test2[0];
TEST4 always gives me a null, I tried changing test3 into an Object or string as well. Here are some of the stuff I tried:
var test4 = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(test3);
var test4 = JsonConvert.DeserializeObject<List<Dictionary<string, int>>>(test3);
var test4 = JsonConvert.DeserializeObject<Dictionary<string, string>(test3);
var test4 = JsonConvert.DeserializeObject<Dictionary<string, int>(test3);
I'm trying to reach the Dictionaries that are in the picture below
https://i.stack.imgur.com/2JWLB.png
I'm sure I'm missing something super simple....
Thanks