Any class that extends from this one will persist through scenes (via Object.DontDestroyOnLoad) and can be handily accessed via the static Instance property.
More...
|
virtual void | OnDestroy () |
| If this is the persistent instance and it was destroyed (manually), remove the instance registration. More...
|
|
virtual void | Start () |
| Disable skipOnLevelWasLoaded. More...
|
|
virtual void | OnPersistentSingletonAwake () |
| This method is called when the Awake() method of the first instance of the persistent singleton is done. This is not called if this is a second instance (which is destroyed automatically immediately). More...
|
|
virtual void | OnPersistentSingletonDestroyed () |
| This method is called when the registered instance of the persistent singleton is either destroyed manually by calling Destroy() or the application is closed. This is not called if this is a second instance (which is destroyed automatically immediately). More...
|
|
virtual void | OnSceneSwitched () |
| This method is called after switching to a new scene. More...
|
|
virtual void | OnAwakeOrSwitch () |
| This method is called immediately after OnPersistentSingletonAwake or OnSceneSwitched. More...
|
|
Any class that extends from this one will persist through scenes (via Object.DontDestroyOnLoad) and can be handily accessed via the static Instance property.
If a new scene is loaded with a new instance of this class while another persistent instance already exists, the new instance in the scene is destroyed. This allows you to make this a prefab and have it in all scenes that you are working on.
- Template Parameters
-
TSubclass | The subclass that extends from this class. |