public void OnDisable() { if (healthVital != null) { healthVital.AddValueListener(OnHealthValueChange); healthVital.AddCurrentValueListener(OnHealthCurrentValueChange); } }
public void OnEnable() { RPGVital health; if (attachedEntity.StatCollection.TryGetStat(healthBarType, out health)) { healthVital = health; healthVital.AddValueListener(OnHealthValueChange); healthVital.AddCurrentValueListener(OnHealthCurrentValueChange); } }
public void OnEnable() { if (attachedEntity.StatCollection.TryGetStat(healthBarType, out healthVital)) { healthVital.AddValueListener(OnHealthValueChange); healthVital.AddCurrentValueListener(OnHealthCurrentValueChange); } if (attachedEntity.StatCollection.TryGetStat(manaBarType, out manaVital)) { manaVital.AddValueListener(OnManaValueChange); manaVital.AddCurrentValueListener(OnManaCurrentValueChange); } if (attachedEntity.StatCollection.TryGetStat(energyBarType, out energyVital)) { energyVital.AddValueListener(OnEnergyValueChange); energyVital.AddCurrentValueListener(OnEnergyCurrentValueChange); } }