void OnStatValueChange(object sender, EventArgs args) { Vital vital = (Vital)sender; if (vital != null) { Debug.Log(string.Format("Value {0}'s OnStatValueChange triggered", vital.Name)); } }
void DisplayStatValues() { ForEachEnum <StatType>((statType) => { Stat stat = _stats.GetStat(statType); if (stat != null) { Vital vital = stat as Vital; Debug.Log(vital != null ? string.Format("Stat {0}'s value is {1}/{2}", vital.Name, vital.CurrentValue, vital.Value) : string.Format("Stat {0}'s value is {1}", stat.Name, stat.Value)); } }); }