If you do a quick search about that topic you’ll find tons of other questions like those:
- properly serialize array of derived classes
- does unity serialization support inheritence
- serializedproperty and abstract custom classes
- list of different classes that all inherit from one class
- serialization in unity
I’ve stopped counting how many times i’ve answered that question ^^.
In short: Unity does not support inheritance for custom serializable classes. Those classes are not serialized on their own but simply as “child data” of the containing MonoBehaviour / ScriptableObject. The type of an instance is not saved at all. Therefore if you store a derived class in a base class variable it will turn into a base class instance after deserialization.
Likewise since the custom classes aren’t stored as seperate instances you can’t have cross references. If two MonoBehaviour classes reference the same custom serializable class instance, after deserialization each will have their own instance. Again: Custom serializable classes are just a neat way to manage serialized fields in a MonoBehaviour.
Of course that’s only true for Unity’s serialization system.