Skip to main content
Version: 2.0.0

Haply::Inverse::Unity::Singleton

A generic singleton class for MonoBehaviour. More...

Inherits from MonoBehaviour

Public Functions​

Name
voidInitializeInstance()
Initializes the singleton instance.
boolExists()

Protected Functions​

Name
virtual voidOnDestroy()
virtual voidOnApplicationQuit()

Public Properties​

Name
TInstance
Gets the instance of the singleton class.

Detailed Description​

template <T >
class Haply::Inverse::Unity::Singleton;

A generic singleton class for MonoBehaviour.

Template Parameters:

  • T Type of the singleton class.

Public Functions Documentation​

function InitializeInstance​

static void InitializeInstance()

Initializes the singleton instance.

Call this method from the main thread during initialization (e.g., in an Awake method).

function Exists​

static bool Exists()

Protected Functions Documentation​

function OnDestroy​

virtual void OnDestroy()

Reimplemented by: Haply::Inverse::Unity::DeviceMapper::OnDestroy

function OnApplicationQuit​

virtual void OnApplicationQuit()

Public Property Documentation​

property Instance​

static T Instance;

Gets the instance of the singleton class.