private void CheckEnemyMissileSpawnerScript() { if (!enemyMissileSpawnerScript) { enemyMissileSpawnerScript = enemyMissileSpawner.GetComponent <EnemyMissileSpawner>(); if (!enemyMissileSpawnerScript) { Debug.LogError("EnemyMissileSpawner script not found in the enemy spawner!"); } } }
// Start is called before the first frame update void Start() { maxAmmo = this.playerMissilesLeft; currentMissilesLoaded = 10; playerMissilesLeft -= 10; myEnemyMissileSpawner = GameObject.FindObjectOfType <EnemyMissileSpawner>(); //myPlayerController = GetComponent<PlayerMissileController>(); GameController.enemySpeedToUse = this.enemyMissileSpeed; UpdateScoreText(); UpdateLevelText(); UpdateMissileLeftText(); UpdatecurrentMissileLoadedText(); StartRound(); }
// Start is called before the first frame update void Start() { // Load 10 player's missiles into launcher, 30 - 10 = 20 currentMissilesLoadedLauncher = 10; playerMissilesLeft -= 10; enemyMissileSpawner = GameObject.FindObjectOfType <EnemyMissileSpawner>(); // Get the number of cities cityCounter = GameObject.FindObjectsOfType <City>().Length; // Update the information on the right top corner UpdateLevelText(); UpdateScoreText(); UpdateMissilesLeftText(); UpdateMissilesInLauncherText(); StartRound(); }