A simple singleton pattern for classes that inherit from MonoBehaviour
without public access to the instance.
More...
|
bool | dontDestroyOnLoad = false |
| Inspector
Set to true if this GameObject should not be destroyed when loading a new scene.
|
|
|
static T | _instance |
| Reference to the singleton instance.
|
|
A simple singleton pattern for classes that inherit from MonoBehaviour
without public access to the instance.
This implementation is not thread-safe.
- Template Parameters
-
T | The type of the derived class. |
- See also
- UnityEngine.MonoBehaviour
-
UnityEngine.GameObject
◆ Awake()
◆ OnDestroy()
virtual void OnDestroy |
( |
| ) |
|
|
protectedvirtual |
◆ _instance
Reference to the singleton instance.
◆ dontDestroyOnLoad
bool dontDestroyOnLoad = false |
Inspector
Set to true
if this GameObject
should not be destroyed when loading a new scene.
The documentation for this class was generated from the following file:
- C:/Users/cgbrown/Development/git/FAST/FAST-SDK/Runtime/Singletons/Singleton.cs