public class ExampleClass
{
public GameObject a;
public SerializableDictionary<int, ExampleClass2> b = new SerializableDictionary<int, ExampleClass2>()
public int c;
protected string d;
protected XYZ e;
}
ExampleClass exampleClass = getExampleClass();
string exampleClassData= JsonUtility.ToJson(exampleClass );
string exampleClassDataJsonDotNet = JsonConvert.SerializeObject(exampleClass );
For the above code while serialization if I use JsonUtility.ToJson
its missing to serialize the SerializableDictionary<int , ExampleClass2> b
, its serializing protected because I added [SerializeField]
and ExampleClass2 is also Serialization supported.
If I used JsonConvert.SerializeObject
its working great will all types but unable to Serialize GameObject
Are there any solution to make it work in any of ways?