Documentation for the Unity C# Library
Loading...
Searching...
No Matches
PixoVR.Apex.ApexSingleton< T > Class Template Reference
Inheritance diagram for PixoVR.Apex.ApexSingleton< T >:
[legend]

Public Member Functions

bool InitializeInstance (T targetInstance)
 
virtual void OnDestroy ()
 When Unity quits, it destroys objects in a random order. In principle, a Singleton is only destroyed when application quits. If any script calls Instance after it have been destroyed, it will create a buggy ghost object that will stay on the Editor scene even after stopping playing the Application. Really bad! So, this was made to be sure we're not creating that buggy ghost object.
 

Properties

static T Instance [get]
 

Static Private Attributes

static bool ApplicationIsQuitting = false
 
static T instance
 
static readonly object lockObject = new object()
 
static readonly string MASTER_TAG = "ApexSingleton"
 

Detailed Description

Type Constraints
T :MonoBehaviour 

Definition at line 7 of file ApexSingleton.cs.

Member Function Documentation

◆ InitializeInstance()

bool PixoVR.Apex.ApexSingleton< T >.InitializeInstance ( T targetInstance)
inline

Definition at line 14 of file ApexSingleton.cs.

◆ OnDestroy()

virtual void PixoVR.Apex.ApexSingleton< T >.OnDestroy ( )
inlinevirtual

When Unity quits, it destroys objects in a random order. In principle, a Singleton is only destroyed when application quits. If any script calls Instance after it have been destroyed, it will create a buggy ghost object that will stay on the Editor scene even after stopping playing the Application. Really bad! So, this was made to be sure we're not creating that buggy ghost object.

Definition at line 93 of file ApexSingleton.cs.

Member Data Documentation

◆ ApplicationIsQuitting

bool PixoVR.Apex.ApexSingleton< T >.ApplicationIsQuitting = false
staticprivate

Definition at line 84 of file ApexSingleton.cs.

◆ instance

T PixoVR.Apex.ApexSingleton< T >.instance
staticprivate

Definition at line 10 of file ApexSingleton.cs.

◆ lockObject

readonly object PixoVR.Apex.ApexSingleton< T >.lockObject = new object()
staticprivate

Definition at line 12 of file ApexSingleton.cs.

◆ MASTER_TAG

readonly string PixoVR.Apex.ApexSingleton< T >.MASTER_TAG = "ApexSingleton"
staticprivate

Definition at line 9 of file ApexSingleton.cs.

Property Documentation

◆ Instance

T PixoVR.Apex.ApexSingleton< T >.Instance
staticget

Definition at line 34 of file ApexSingleton.cs.


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