SingletonT Class |
Namespace: DustProductions.Core
public class Singleton<T> : MonoBehaviour where T : MonoBehaviour
The SingletonT type exposes the following members.
Name | Description | |
---|---|---|
SingletonT | Initializes a new instance of the SingletonT class |
Name | Description | |
---|---|---|
HasInstance |
Checks if there is an instance of this Singleton in this object without creating one
| |
Instance |
Returns the instance of this Singleton, and creates one if it doesn't exist
| |
PersistsBetweenLoads |
Should this object survive a scene change?
|
Name | Description | |
---|---|---|
Awake |
This checks for any other Singletons and destroys itself if one exists.
| |
CreateInstance |
If you want more control over when Singletons are created, you can use this to generate it instead of blindly calling the .Instance.
|
Name | Description | |
---|---|---|
_Instance |
The backing variable for Instance. Probably should not access this directly.
|
Name | Description | |
---|---|---|
AnnounceComponentAdded |
Notifies any IComponentHandlers on the GameObject a Component is added to, that the Component has been added.
(Defined by ExtensionMethods.) | |
StartCoroutineT |
Use by calling this.StartCoroutine and assigning it to a Coroutine. Then you can call your assigned coroutine.Cancel(), or .HasFinished, or a variety of other neat things.
(Defined by ExtensionMethods.) | |
TryGetComponentT(T, Boolean) | Overloaded.
Attempts to get a component on a gameobject.
(Defined by ExtensionMethods.) | |
TryGetComponentT1, T2(T1, Boolean) | Overloaded.
Attempts to get a component on a gameobject.
(Defined by ExtensionMethods.) | |
TryGetComponentsT(T, Boolean) | Overloaded.
Attempts to get components on a gameobject.
(Defined by ExtensionMethods.) | |
TryGetComponentsT1, T2(T1, Boolean) | Overloaded.
Attempts to get components on a gameobject.
(Defined by ExtensionMethods.) |