Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ManlySingleton< T > Class Template Reference
Inheritance diagram for ManlySingleton< T >:
SingletonBase

Public Member Functions

override void Elect ()
 
abstract void Elect ()
 

Static Public Member Functions

static bool Exists ()
 

Protected Member Functions

void Abdicate ()
 
virtual void OnDestroy ()
 

Properties

static T?? Instance [get]
 
static T InstanceOrNull [get]
 
static Transform STransform [get]
 
static Vector3 SPosition [get, set]
 
static GameObject SGameObject [get]
 

Static Private Attributes

static T myInstance
 

Detailed Description

Type Constraints
T :MonoBehaviour 

Definition at line 3 of file ManlySingleton.cs.

Member Function Documentation

◆ Abdicate()

void ManlySingleton< T >.Abdicate ( )
inlineprotected

Definition at line 59 of file ManlySingleton.cs.

60 {
61 if (myInstance == this)
62 {
63 myInstance = null;
64 }
65 }
static T myInstance

References ManlySingleton< T >.myInstance.

◆ Elect()

override void ManlySingleton< T >.Elect ( )
inlinevirtual

Implements SingletonBase.

Definition at line 54 of file ManlySingleton.cs.

55 {
56 myInstance = this as T;
57 }

References ManlySingleton< T >.myInstance.

◆ Exists()

static bool ManlySingleton< T >.Exists ( )
inlinestatic

Definition at line 49 of file ManlySingleton.cs.

50 {
51 return InstanceOrNull != null;
52 }
static T InstanceOrNull

References ManlySingleton< T >.InstanceOrNull.

◆ OnDestroy()

virtual void ManlySingleton< T >.OnDestroy ( )
inlineprotectedvirtual

Definition at line 67 of file ManlySingleton.cs.

68 {
69 myInstance = null;
70 }

References ManlySingleton< T >.myInstance.

Member Data Documentation

◆ myInstance

T ManlySingleton< T >.myInstance
staticprivate

Property Documentation

◆ Instance

T?? ManlySingleton< T >.Instance
staticget

Definition at line 7 of file ManlySingleton.cs.

8 {
9 get
10 {
11 if (myInstance == null)
12 {
13 Object[] array = Object.FindObjectsOfType(typeof(T));
14 if (array.Length > 1)
15 {
16 Debug.LogError("<B>Doubleton?</B> Do you really want two instances of <B><i>" + typeof(T).Name + "</i></B>?\n", array[1]);
17 }
18 if (array.Length >= 1)
19 {
20 myInstance = (T)array[0];
21 }
22 if (myInstance == null)
23 {
24 Debug.LogError("An instance of " + typeof(T).Name + " could not be found. Add it to the scene.");
25 }
26 }
27 return myInstance;
28 }
29 }

Referenced by UiInputField.Start().

◆ InstanceOrNull

T ManlySingleton< T >.InstanceOrNull
staticget

Definition at line 31 of file ManlySingleton.cs.

Referenced by ManlySingleton< T >.Exists().

◆ SGameObject

GameObject ManlySingleton< T >.SGameObject
staticget

Definition at line 47 of file ManlySingleton.cs.

◆ SPosition

Vector3 ManlySingleton< T >.SPosition
staticgetset

Definition at line 35 of file ManlySingleton.cs.

36 {
37 get
38 {
39 return Instance.transform.position;
40 }
41 set
42 {
43 Instance.transform.position = value;
44 }
45 }
static T?? Instance

◆ STransform

Transform ManlySingleton< T >.STransform
staticget

Definition at line 33 of file ManlySingleton.cs.


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