Catlike Coding
Unity Code Documentation
Public Attributes | List of all members
CatlikeCoding.Utilities.ScenePersistentObject Class Reference

Makes sure the game object isn't destroyed when another scene is loaded. Can be configured to make sure no two such objects with the same name exist. More...

Inherits MonoBehaviour.

Public Attributes

bool onlyOnce
 Whether only one version of this object should exist. More...
 

Detailed Description

Makes sure the game object isn't destroyed when another scene is loaded. Can be configured to make sure no two such objects with the same name exist.

To guarantee that duplicates are destroyed, place this script at the top of the script execution order.

Member Data Documentation

bool CatlikeCoding.Utilities.ScenePersistentObject.onlyOnce

Whether only one version of this object should exist.