So I have a scriptable object which has a list of BaseClass. However, there are other classes that I wrote which inherits from the BaseClass. So I decided to use Polymorphism and shove everything in that list. For a second, I thought everything was going fine… BUT, after I restarted unity, all the objects that were inherited from the base class turned into base classes. (I cant type cast it, and gives me an error “cannot cast from source type to destination type”)
I suspect this is a problem from serialization or a problem on how I import my objects…
This is how I import it:
itemListData = (ItemDatabase)AssetDatabase.LoadAssetAtPath(currentItemListLocation, typeof(ItemDatabase));
And this is my database class
public class ItemDatabase : ScriptableObject {
public List<BaseClass> itemList = new List<BaseClass>();
}