Skip to main content

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.

Constructors​

MemberWhat it is
Instance(GameObject prefab, float health)Creates an Instance from prefab and health.

Fields​

2 private and internal fields
MemberWhat it is
private float healthBase health value to give the prefab's health stat.
private GameObject prefabThe prefab whose HealthObject gets the health value.

Methods​

MemberWhat 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
MemberWhat it is
private GameObject GetInstance(GameObject prefab, Transform parent)Meant to return the prefab instance under the parent; stubbed to return null in this build, so Apply and ApplyReference would throw.

Used in​

Members of other types that take, return or hold a Instance: