Class MonoSingleton<T>
- Namespace
- Glitch9
A singleton implementation for MonoBehaviour, ensuring only a single instance of MonoBehaviour exists in the scene, and it persists across scene loads.
public class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T>
Type Parameters
T
Type of the subclass.
- Inheritance
-
MonoSingleton<T>
- Derived
- Extension Methods
Properties
Instance
Provides a global access point to the singleton instance.
public static T Instance { get; }
Property Value
- T
Methods
Awake()
protected virtual void Awake()
OnApplicationQuit()
protected virtual void OnApplicationQuit()
OnDisable()
protected virtual void OnDisable()
OnEnable()
protected virtual void OnEnable()