![]() |
AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
|
Singleton behaviour class, used for components that should only have one instance. More...
Static Public Member Functions | |
| static void | AssertIsInitialized () |
| static bool | ConfirmInitialized () |
| Awake and OnEnable safe way to check if a Singleton is initialized. More... | |
Protected Member Functions | |
| virtual void | Awake () |
| Base Awake method that sets the Singleton's unique instance. Called by Unity when initializing a MonoBehaviour. Scripts that extend Singleton should be sure to call base.Awake() to ensure the static Instance reference is properly created. More... | |
| virtual void | OnDestroy () |
| Base OnDestroy method that destroys the Singleton's unique instance. Called by Unity when destroying a MonoBehaviour. Scripts that extend Singleton should be sure to call base.OnDestroy() to ensure the underlying static Instance reference is properly cleaned up. More... | |
Properties | |
| static T | Instance [get] |
| Returns the Singleton instance of the classes type. If no instance is found, then we search for an instance in the scene. If more than one instance is found, we throw an error and no instance is returned. More... | |
| static bool | IsInitialized [get] |
| Returns whether the instance has been initialized or not. More... | |
Singleton behaviour class, used for components that should only have one instance.
Singleton classes live on through scene transitions and will mark their parent root GameObject with Object.DontDestroyOnLoad
| T | The Singleton Type |
| T | : | Singleton<T> |
Definition at line 14 of file Singleton.cs.
|
static |
Definition at line 49 of file Singleton.cs.
|
protectedvirtual |
Base Awake method that sets the Singleton's unique instance. Called by Unity when initializing a MonoBehaviour. Scripts that extend Singleton should be sure to call base.Awake() to ensure the static Instance reference is properly created.
Reimplemented in HoloToolkit.UI.Keyboard.Keyboard, HoloToolkit.Sharing.SharingStage, HoloToolkit.Unity.InputModule.InputManager, HoloToolkit.Sharing.Tests.ImportExportAnchorManager, HoloToolkit.Unity.InputModule.GazeManager, HoloToolkit.Unity.SpatialUnderstanding, HoloToolkit.Unity.SpatialMapping.SpatialMappingManager, HoloToolkit.Unity.InputModule.MotionControllerVisualizer, HoloToolkit.Unity.TimerScheduler, HoloToolkit.Unity.FadeManager, HoloToolkit.Unity.SceneLauncher, and HoloToolkit.Unity.InputModule.FocusManager.
Definition at line 81 of file Singleton.cs.
|
static |
Awake and OnEnable safe way to check if a Singleton is initialized.
Definition at line 69 of file Singleton.cs.
|
protectedvirtual |
Base OnDestroy method that destroys the Singleton's unique instance. Called by Unity when destroying a MonoBehaviour. Scripts that extend Singleton should be sure to call base.OnDestroy() to ensure the underlying static Instance reference is properly cleaned up.
Reimplemented in HoloToolkit.UI.Keyboard.Keyboard, HoloToolkit.Sharing.Tests.ImportExportAnchorManager, HoloToolkit.Sharing.SharingStage, HoloToolkit.Examples.SpatialUnderstandingFeatureOverview.AppState, HoloToolkit.Unity.SpatialUnderstanding, HoloToolkit.Sharing.Tests.CustomMessages, HoloToolkit.Unity.SpatialMapping.Tests.SpatialProcessingTest, HoloToolkit.Unity.InputModule.MotionControllerVisualizer, HoloToolkit.Unity.FadeManager, HoloToolkit.Sharing.Utilities.AutoJoinSessionAndRoom, HoloToolkit.Sharing.Tests.RemoteHeadManager, HoloToolkit.Examples.GazeRuler.ModeTip, and HoloToolkit.Examples.SpatialUnderstandingFeatureOverview.ShapeDefinition.
Definition at line 110 of file Singleton.cs.
|
staticget |
Returns the Singleton instance of the classes type. If no instance is found, then we search for an instance in the scene. If more than one instance is found, we throw an error and no instance is returned.
Definition at line 26 of file Singleton.cs.
|
staticget |
Returns whether the instance has been initialized or not.
Definition at line 58 of file Singleton.cs.