Пример #1
0
 public void DealDamage(int damage)
 {
     onHit?.Hit();
     currentHealth -= damage;
     if (healthText != null)
     {
         healthText.text = $"HP: {currentHealth}/{maxHealth}";
     }
     if (currentHealth <= 0)
     {
         this.gameObject.SetActive(false);
         zeroHealthActions.Invoke();
     }
 }