Class SingletonBehaviour<T>
Inheritance
object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
SingletonBehaviour<T>
Namespace: Global
Assembly: Dew.Core.dll
Syntax
public class SingletonBehaviour<T> : MonoBehaviour where T : MonoBehaviour
Type Parameters
| Name | Description |
|---|---|
| T |
Properties
instance
If you expect the instance to be null, you MUST USE softInstance in Update loops.
This will call FindObjectOfType if current instance is null, which can be very expensive.
Declaration
public static T instance { get; }
Property Value
| Type | Description |
|---|---|
| T |
softInstance
Declaration
public static T softInstance { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
Awake()
Declaration
protected virtual void Awake()