MonoSingleton(T) Class

Ultimate Replay

MonoSingletonT Class
Singleton imeplentation using MonoBehaviour as a base class. A dedicated owner object is created so that the singleton instance can be attached to it.
Inheritance Hierarchy
SystemObject  Object
    Component
      Behaviour
        MonoBehaviour
          UltimateReplay.UtilMonoSingletonT
            UltimateReplayReplayManager

Namespace: UltimateReplay.Util
Assembly: UltimateReplay (in UltimateReplay.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public abstract class MonoSingleton<T> : MonoBehaviour
where T : MonoSingleton<T>

Type Parameters

T
The generic type that the singleton is wrapping

The MonoSingletonT type exposes the following members.

Constructors
  NameDescription
Protected methodMonoSingletonT
Initializes a new instance of the MonoSingletonT class
Top
Methods
  NameDescription
Public methodAwake
Called by Unity. Allows the singleton to find and claim any scene instances.
Public methodStatic memberForceAwake
Attempts to forcefully create the singleton instance if one does not already exist.
Public methodOnApplicationQuit
Called by Unity. Allows the singleton to prevent recreation of the instance when the game is about to quit.
Top
Fields
  NameDescription
Protected fieldStatic memberactive
The active singleton instance or null if no instance has been created yet. Use Active to guarentee that the instance is non-null.
Top
Properties
  NameDescription
Public propertyStatic memberActive
Get the active singleton instance. If not instance exists then one is created.
Public propertyStatic memberIsDisposing
Returns true if the singleton is currently disposing. This will only occur when the game is about to quit.
Top
See Also