FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
SingletonWithInstance< T > Class Template Referenceabstract

A simple singleton pattern for classes that inherit from MonoBehaviour with public access to the instance. More...

Inheritance diagram for SingletonWithInstance< T >:
Singleton< T >

Properties

static T Instance [get]
 Provides public access to FAST.Singleton<T>._instance.
 

Additional Inherited Members

- Public Attributes inherited from Singleton< T >
bool dontDestroyOnLoad = false
 Inspector
Set to true if this GameObject should not be destroyed when loading a new scene.
 
- Protected Member Functions inherited from Singleton< T >
virtual void Awake ()
 Sets FAST.Singleton<T>._instance and destorys any additional instances.
 
virtual void OnDestroy ()
 Sets FAST.Singleton<T>._instance to null when the last instance is destroyed.
 
- Static Protected Attributes inherited from Singleton< T >
static T _instance
 Reference to the singleton instance.
 

Detailed Description

A simple singleton pattern for classes that inherit from MonoBehaviour with public access to the instance.

This implementation is not thread-safe.

Template Parameters
TThe type of the derived class.
See also
UnityEngine.MonoBehaviour
Type Constraints
T :SingletonWithInstance<T> 

Property Documentation

◆ Instance

T Instance
staticget

Provides public access to FAST.Singleton<T>._instance.


The documentation for this class was generated from the following file: