Base-class for all singletons. More...

Inheritance diagram for Crosstales.Common.Util.Singleton< T >:

Static Public Member Functions

static void CreateInstance (bool searchExistingGameObject=true, bool deleteExistingInstance=false)
 Creates an instance of this object. More...
 
static void DeleteInstance ()
 Deletes the instance of this object. More...
 

Static Public Attributes

static string PrefabPath
 Fully qualified prefab path. More...
 
static string GameObjectName = typeof(T).Name
 Name of the gameobject in the scene. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void OnDestroy ()
 
virtual void OnApplicationQuit ()
 

Static Protected Attributes

static T instance
 

Properties

static T Instance [get, protected set]
 Returns the singleton instance of this class. More...
 
bool DontDestroy [get, set]
 Don't destroy gameobject during scene switches. More...
 

Detailed Description

Base-class for all singletons.

Type Constraints
T :Singleton<T> 

Member Function Documentation

◆ CreateInstance()

static void Crosstales.Common.Util.Singleton< T >.CreateInstance ( bool  searchExistingGameObject = true,
bool  deleteExistingInstance = false 
)
static

Creates an instance of this object.

Parameters
searchExistingGameObjectSearch for existing GameObjects of this object (default: true, optional)
deleteExistingInstanceDelete existing instance of this object (default: false, optional)

◆ DeleteInstance()

static void Crosstales.Common.Util.Singleton< T >.DeleteInstance ( )
static

Deletes the instance of this object.

Member Data Documentation

◆ GameObjectName

string Crosstales.Common.Util.Singleton< T >.GameObjectName = typeof(T).Name
static

Name of the gameobject in the scene.

◆ PrefabPath

string Crosstales.Common.Util.Singleton< T >.PrefabPath
static

Fully qualified prefab path.

Property Documentation

◆ DontDestroy

bool Crosstales.Common.Util.Singleton< T >.DontDestroy
getset

Don't destroy gameobject during scene switches.

◆ Instance

T Crosstales.Common.Util.Singleton< T >.Instance
staticgetprotected set

Returns the singleton instance of this class.

Returns
Singleton instance of this class.

The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/TrueRandom/TrueRandomPro/Assets/Plugins/crosstales/Common/Scripts/Util/Singleton.cs