Tanoda
GILES.pb_MonoBehaviourSingleton< T > Class Template Reference
Inheritance diagram for GILES.pb_MonoBehaviourSingleton< T >:

Protected Member Functions

virtual void Initialize ()
 
virtual void Awake ()
 

Properties

virtual bool dontDestroyOnLoad [get]
 Override to maintain an instance of this object across level loads. More...
 
static T instance [get]
 
static T nullableInstance [get]
 

Detailed Description

A singleton implementation for MonoBehaviours.

Type Constraints
T :MonoBehaviour 

Definition at line 8 of file pb_MonoBehaviourSingleton.cs.

Member Function Documentation

◆ Awake()

virtual void GILES.pb_MonoBehaviourSingleton< T >.Awake ( )
protectedvirtual

If overriding, be sure to call base.Awake().

Reimplemented in GILES.pb_Selection, GILES.pb_GizmoManager, GILES.pb_InputManager, GILES.pb_Scene, GILES.pb_SelectionHandle, and NetworkManager.

Definition at line 76 of file pb_MonoBehaviourSingleton.cs.

◆ Initialize()

virtual void GILES.pb_MonoBehaviourSingleton< T >.Initialize ( )
protectedvirtual

Called when an instance is initialized due to no previous instance found. Use this to initialize any resources this singleton requires (eg, if this is a gui item or prefab, build out the hierarchy in here or instantiate stuff).

Definition at line 21 of file pb_MonoBehaviourSingleton.cs.

Property Documentation

◆ dontDestroyOnLoad

virtual bool GILES.pb_MonoBehaviourSingleton< T >.dontDestroyOnLoad
get

Override to maintain an instance of this object across level loads.

Definition at line 14 of file pb_MonoBehaviourSingleton.cs.

◆ instance

T GILES.pb_MonoBehaviourSingleton< T >.instance
staticget

Get an instance to this MonoBehaviour. Always returns a valid object.

See also
nullableInstance

Definition at line 27 of file pb_MonoBehaviourSingleton.cs.

◆ nullableInstance

T GILES.pb_MonoBehaviourSingleton< T >.nullableInstance
staticget

Return the instance if it has been initialized, null otherwise.

Definition at line 68 of file pb_MonoBehaviourSingleton.cs.


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