Summary
Holds an instance of T which is automatically created
using its parameterless constructor when first accessed.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["Static<T>"]
class Type type-node
Syntax
public static class Static<T> where T : class, new()
Remarks
Don't use classes that inherit from
UnityEngine.Object
as T.
This is close to the "Singleton Programming Pattern", except it can't prevent additional instances of
T from being created elsewhere.
Type Parameters
Name | Description |
---|---|
T |
Fields
Name | Constant Value | Summary |
---|---|---|
Instance |
An instance of T which is automatically created
using its parameterless constructor when first accessed.
static
|
Methods
Name | Value | Summary |
---|---|---|
AssertSingularity |
void |
[Assert-Conditional]
Call this in the constructor of T to make sure there is only one instance.
static
|
Initialize |
void |
Ensures that the
Animancer.Static`1.Instance has been created without immediately using it.static
|