public void DealDamage(int value) { hp -= value; if (playerStatsUI != null) { playerStatsUI.UpdateHealth(); } }
public void DoDamage(int value) { if (value < 0) { Debug.LogError("Try to do negative damage!"); return; } health -= value; if (statsUI != null) { statsUI.UpdateHealth(); } }