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

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()
 

Detailed Description

Type Constraints
T :MonoBehaviour 

Definition at line 7 of file ApexSingleton.cs.

Member Function Documentation

◆ 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 72 of file ApexSingleton.cs.

Member Data Documentation

◆ ApplicationIsQuitting

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

Definition at line 63 of file ApexSingleton.cs.

◆ instance

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

Definition at line 9 of file ApexSingleton.cs.

◆ lockObject

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

Definition at line 11 of file ApexSingleton.cs.

Property Documentation

◆ Instance

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

Definition at line 13 of file ApexSingleton.cs.


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