Inventory Engine  v3.8
Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Attributes | Properties | List of all members
MoreMountains.Tools.MMPersistentHumbleSingleton< T > Class Template Reference

Persistent humble singleton, basically a classic singleton but will destroy any other older components of the same type it finds on awake More...

Inherits MonoBehaviour.

Public Attributes

float InitializationTime
 the timestamp at which this singleton got initialized More...
 

Static Public Attributes

static bool HasInstance => _instance != null
 whether or not this singleton already has an instance More...
 
static T Current => _instance
 

Protected Member Functions

virtual void Awake ()
 On awake, we check if there's already a copy of the object in the scene. More...
 
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Attributes

static T _instance
 

Properties

static T Instance [get]
 Singleton design pattern More...
 

Detailed Description

Persistent humble singleton, basically a classic singleton but will destroy any other older components of the same type it finds on awake

Type Constraints
T :Component 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.Tools.MMPersistentHumbleSingleton< T >.Awake ( )
protectedvirtual

On awake, we check if there's already a copy of the object in the scene.

If there's one, we destroy it.

◆ InitializeSingleton()

virtual void MoreMountains.Tools.MMPersistentHumbleSingleton< T >.InitializeSingleton ( )
protectedvirtual

Initializes the singleton.

Member Data Documentation

◆ _instance

T MoreMountains.Tools.MMPersistentHumbleSingleton< T >._instance
staticprotected

◆ Current

◆ HasInstance

bool MoreMountains.Tools.MMPersistentHumbleSingleton< T >.HasInstance => _instance != null
static

whether or not this singleton already has an instance

◆ InitializationTime

float MoreMountains.Tools.MMPersistentHumbleSingleton< T >.InitializationTime

the timestamp at which this singleton got initialized

Property Documentation

◆ Instance

Singleton design pattern

The instance.


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