trash-canDestroying Saveable Objects

The traditional way of destroying objects in Unity will not persist the destruction in OmniSave. For destruction to persist, you´ll need to explicitly tell OmniSave when a Destruction happened;

NEVER use Destroy() directly on saveable objects!

// Wrong: Will respawn on load, destruction will not persist.
Destroy(gameObject);

// Correct: Persists destruction
// ( Option #1 )
GetComponent<Saveable>().DestroySelf();
// or ( Option #2 )
SaveManager.DestroyPersistent(gameObject);

Last updated