public void Hit(float dmg) { curHp -= (int)dmg; if (curHp <= 0) { curHp = 0; enemyManager.deathCount++; enemyManager.RenewScore(); enemyHpBar.SetHpBar((float)curHp / hp); op.Disable(gameObject); } enemyHpBar.SetHpBar((float)curHp / hp); }
protected void UpdateHud() { if (enemyHpBar != null) { enemyHpBar.SetHpBar((float)hp, (float)hpMax); } }