Exemplo n.º 1
0
    public void Heal(float health)
    {
        _health = Mathf.Min(_health + health, _maxhealth);
        DamageNumber dn = Instantiate(_damagePopup, _popupTransform).GetComponent <DamageNumber>();

        dn.SetDamageNumber(health);
    }
Exemplo n.º 2
0
    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();
    }