/// <summary> /// Inflicts damage and check if the object should be destroyed /// </summary> /// <param name="damageCount"></param> public void Damage(int damageCount) { hp = hp - damageCount; if (hp <= 0) { // Dead! if (isEnemy) { highscore.IncreaseHighscore(1); } Destroy(gameObject); } }