Feel  5.2
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMPersistentSingleton< T > Class Template Reference

Persistent singleton. More...

Inheritance diagram for MoreMountains.Tools.MMPersistentSingleton< T >:

Public Attributes

bool AutomaticallyUnparentOnAwake = true
 if this is true, this singleton will auto detach if it finds itself parented on awake More...
 

Static Public Attributes

static bool HasInstance => _instance != null
 
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. If there's one, we destroy it. More...
 
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Protected Attributes

bool _enabled
 

Static Protected Attributes

static T _instance
 

Properties

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

Detailed Description

Persistent singleton.

Type Constraints
T :Component 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.Tools.MMPersistentSingleton< 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.

Reimplemented in MoreMountains.Tools.MMPersistenceManager, and MoreMountains.Tools.MMSoundManager.

◆ InitializeSingleton()

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

Initializes the singleton.

Member Data Documentation

◆ _enabled

bool MoreMountains.Tools.MMPersistentSingleton< T >._enabled
protected

◆ _instance

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

◆ AutomaticallyUnparentOnAwake

bool MoreMountains.Tools.MMPersistentSingleton< T >.AutomaticallyUnparentOnAwake = true

if this is true, this singleton will auto detach if it finds itself parented on awake

◆ Current

◆ HasInstance

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

Property Documentation

◆ Instance

T MoreMountains.Tools.MMPersistentSingleton< T >.Instance
staticget

Singleton design pattern

The instance.


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