cubeScriptableObjects & Polymorphism

Scriptable Objects

Omni Save stores ScriptableObject references by path, not by value. This ensures that when you save data containing ScriptableObjects, such as an inventory list, each entry correctly reconnects to its original asset when loaded.

circle-exclamation

Polymorphism

Omni Save supports interfaces and abstract classes automatically, preserving the concrete types of each object during serialization. This makes it easy to save heterogeneous collections such as inventories, ability lists, or event data.

interface IItem { }
class Sword : IItem { }
class Shield : IItem { }

List<IItem> items = new List<IItem> { new Sword(), new Shield() };
SaveManager.Save("inventory", items); // Preserves types!

Last updated