Class Singleton<T>
This is generic singleton implementation.
This is the best way to implement singleton in Unity, see
Inheritance
System.Object
Singleton<T>
Namespace: Marus.Utils
Assembly: cs.temp.dll.dll
Syntax
public class Singleton<T> : MonoBehaviour where T : Component
Type Parameters
Name | Description |
---|---|
T |
Fields
instance
Declaration
protected static T instance
Field Value
Type | Description |
---|---|
T |
Properties
Instance
Declaration
public static T Instance { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Initialize()
Declaration
protected virtual void Initialize()