I am trying to figure out if it is possible to parse multiple json files that are referencing each other into C# class structure.
Example:
Class json file
{
"wizard" :
{
"type" : "ice",
"spells" : ["ice_orb", "ice_storm"]
}
}
Spells json file:
{
"spells" :
{
"ice_orb":
{
"damage": 25,
"cooldown": 2
},
"ice_storm":
{
"damage": 35,
"cooldown": 4
}
}
}
Expected Result:
[Serializable]
public class IceOrb
{
public int damage;
public int cooldown;
}
[Serializable]
public class IceStorm
{
public int damage;
public int cooldown;
}
[Serializable]
public class Spell
{
public IceOrb ice_orb;
public IceStorm ice_storm;
}
[Serializable]
public class Wizard
{
public string type;
public List<Spell> spells;
}
Please do not suggest to merge everything in one file because it is not an option for me.