Class SingletonMonoBehaviour<T>
- Namespace
- CodeBase
- Assembly
- 4Experience.CodeBase.Core.Runtime.dll
Default implementation of Singleton for MonoBehaviour scripts. Handles the life cycle of the MonoBehaviour object in case a duplicate needs to be destroyed.
public abstract class SingletonMonoBehaviour<T> : BaseSingletonMonoBehaviour where T : Component
Type Parameters
T
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourSingletonMonoBehaviour<T>
- Derived
- Extension Methods
Properties
Instance
public static T Instance { get; private set; }
Property Value
- T
Methods
Awake()
protected override sealed void Awake()
Decommission()
Method called when a Singleton instance is destroyed within the OnDestroy callback. It is used to overwrite the destroyed behavior.
protected virtual void Decommission()
Initialize()
Method called when a Singleton instance is created within the Awake callback. It is used to override the initialization behavior.
protected virtual void Initialize()
OnDestroy()
protected override sealed void OnDestroy()