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

            health -= value;
            if (statsUI != null)
            {
                statsUI.UpdateHealth();
            }
        }