public void Heal(float health) { _health = Mathf.Min(_health + health, _maxhealth); DamageNumber dn = Instantiate(_damagePopup, _popupTransform).GetComponent <DamageNumber>(); dn.SetDamageNumber(health); }
public void OnHit(float damage, string cause) { if (!alive) { return; } _cause = cause; _health -= damage; DamageNumber dn = Instantiate(_damagePopup, _popupTransform).GetComponent <DamageNumber>(); dn.SetDamageNumber(-damage); UpdateHealth(); }