public void SetEnemyCountTexts() { totalAiPilots = FindObjectsOfType <AI>().Length; totalDrones = FindObjectsOfType <Enemy>().Length; if (enemyCountText) { enemyCountText.text = "x" + totalAiPilots; } if (droneCountText) { droneCountText.text = "x" + totalDrones; } int totalEnemies = totalAiPilots + totalDrones; if (totalEnemies < 1) { inGameMenu.MissionComplete(); } }