Hi there,
I've tested this at my end and it appears to be working fine. Are you on the latest version of Easy Save?
I used the following script:
Code: Select all
using UnityEngine;
public class InheritenceTest : MonoBehaviour
{
void Start()
{
ParentClass obj = new ChildClass();
obj.myInt = 456;
ES3.Save("obj", obj);
var newObj = ES3.Load<ParentClass>("obj");
Debug.Assert(newObj.myInt == 456);
}
}
public class ParentClass
{
[ES3Serializable]
public int myInt = 123;
}
public class ChildClass : ParentClass
{
public string myString = "myStr";
}
The data stored in the file is:
Code: Select all
{
"obj" : {
"__type" : "ParentClass,Assembly-CSharp",
"value" : {
"__type" : "ChildClass,Assembly-CSharp",
"myString" : "myStr",
"myInt" : 456
}
}
}
If you're on the latest version you might want to try deleting the package from the package cache and then re-downloading in case an issue has occurred at Unity's end and it's not imported the complete package, meaning old files will remain:
https://docs.unity3d.com/Manual/upm-del ... cache.html
All the best,
Joel