A class in Root.Township, Alta.StatSystem.
Editor tool component with inspector buttons for saving, loading and fixing up health stat setups on network prefabs. Not used at runtime.
Constructors
| Member | What it is |
|---|
HealthValidation() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private bool btnApplyRef | Inspector button for ApplyRefs. |
private bool btnLoad | Inspector button for LoadData. |
private bool btnSave | Inspector button for SaveData. |
private bool btnValidateChildren | Inspector button for ValidateChildren. |
private HealthData data | The HealthData asset used by the buttons. |
private StatDefinition healthStat | The health stat definition used when loading. |
Methods
| Member | What it is |
|---|
void ApplyRefs() | Applies stored stat manager references from the data to children, through the private statManager field. |
void LoadData() | Applies the stored health data to children using healthStat. |
void SaveData() | Fills the data with the health of every network prefab in Resources. Creates the data asset if missing, without filling it. |
void ValidateChildren() | Makes sure each child HealthObject has a stat manager with a definition, copying it from a same named child. |
1 private and internal method
| Member | What it is |
|---|
private StatDefinitionApplication GetRelatedApplication(string objectName) | Finds a child with the given name and returns the first definition application on its stat manager. |