How to use json.net(JObject/Jarray/Jtoken) and convert to class in the fastest(performance) way into a dictionary? the key of the dictionary is the sees "name" in the json file
Can anyone help?
Thanks alot!
seed.json
{
"Seed": [
{
"name": "Cheetone",
"growthrate": 1,
"cost": 500
},
{
"name": "Tortone",
"growthrate": 8,
"cost": 100
}
],
}
public class SoilStat
{
public int growthRate;
public int cost;
}
public class DataLoader : MonoSingleton<DataLoader>
{
public string txt;
Dictionary<string, SoilStat> _soilList = new Dictionary<string, SoilStat>();
JObject rawJson = JObject.Parse(txt);
???
}