Instance
A class in Root.Township, Alta.StatSystem.
One entry in a HealthData asset: a prefab and the base health it should get. Editor and bake tooling; in this build GetInstance always returns null.
- Listed in Stats, effects, heat and liquid
- Derived types
HealthData
Constructors
| Member | What it is |
|---|---|
Instance(GameObject prefab, float health) | Creates an Instance from prefab and health. |
Fields
2 private and internal fields
| Member | What it is |
|---|---|
private float health | Base health value to give the prefab's health stat. |
private GameObject prefab | The prefab whose HealthObject gets the health value. |
Methods
| Member | What it is |
|---|---|
void Apply(StatDefinition healthStat, Transform parent) | Finds the prefab's HealthObject, adds a StatManager if missing and sets its base value for the given health stat to health. |
void ApplyReference(FieldInfo field, Transform parent) | Sets the given field on the prefab's HealthObject to that object's StatManager, probably via reflection from editor tooling. |
1 private and internal method
Used in
Members of other types that take, return or hold a Instance: