public void TakeDamage(float damage) { if (!beingAttacked) { beingAttacked = true; } // tell the map manager im under attack mapScript.CheckForAnAttack(gameObject); tileHitPoints = tileHitPoints - damage; if (tileHitPoints <= 0) { // check if I'm a capital if (myTag == "Capital") { Capital capital = GetComponent <Capital>(); capital.CallGameOver(); } else { KillTile(); } } }