Class Singleton<T>
A class to handle object instances.
public sealed class Singleton<T> : TypeCastObject<T> where T : classType Parameters
- T
- The type of the object to handle the instance of. 
- Inheritance
- 
      
      
      Singleton<T>
- Inherited Members
- Extension Methods
Constructors
Singleton(T)
Initializes a new instance of the Singleton<T> class.
public Singleton(T value)Parameters
- valueT
- The branch to instantiate. 
Properties
Instance
Gets the relative value.
public static T Instance { get; }Property Value
- T
Methods
Create(T)
A class to handle object instances.
public static void Create(T @object)Parameters
- objectT
Destroy(T)
Destroys the given T instance.
public static bool Destroy(T @object)Parameters
- objectT
- The object to destroy. 
Returns
~Singleton()
Finalizes an instance of the Singleton<T> class.
protected ~Singleton()TryGet<TObject>(out TObject)
Tries to get the relative value.
public static bool TryGet<TObject>(out TObject instance) where TObject : classParameters
- instanceTObject
- The object instance. 
Returns
- bool
- true if the object instance is not null and can be casted as the specified type; otherwise, false. 
Type Parameters
- TObject
- The type of the object. 
Operators
implicit operator T(Singleton<T>)
Converts the given Singleton<T> instance into T.
public static implicit operator T(Singleton<T> instance)Parameters
- instanceSingleton<T>
- The Singleton<T> instance to convert. 
Returns
- T