SingletonBehavior<T>
Class in Zigurous.DataStructures
Declaration
public abstract class SingletonBehavior<T> : MonoBehaviour where T : Component
Description
A singleton behavior that can be used to ensure that only one instance of a class is created.
Type Parameters
T | The type of the singleton class. |
Static Properties
Instance | The current instance of the class. The instance will be created if it does not already exist. |
HasInstance | Checks if the singleton has been initialized and an instance is available to use. |
Methods
SetUp | Handles initializing the singleton on Awake. This function should be used in replacement of Awake. |
TearDown | Handles deinitializing the singleton. This function should be used in replacement of OnDestroy. |