void Start() { playerController = GameObject.FindWithTag("Player").GetComponent <PlayerController>(); enemySoundSource = GetComponent <AudioSource>(); spawnEnemies(); totalEnemies = EnemiesPerRow * EnemiesPerColumn; allowedDeadEnemiesAmt = (int)(totalEnemies * 0.8f); reduceMovementDelayAmount = 1.0f / totalEnemies; reduceShootWaitTimeAmount = (maximumShootWaitTime - 1.0f) / totalEnemies; amountToIncreaseShotPercentageBy = (MAXIMUM_ACCEPTED_SHOT_ROLL - currentAcceptedShotRoll) / totalEnemies; amountToIncreaseSightDistanceBy = (10.0f - currentSightDistance) / totalEnemies; relativeInvaderDistanceY = new Vector3(0.0f, -spawnHeight, 0.0f); invaderMovementScripts = (InvaderMovement[])FindObjectsOfType(typeof(InvaderMovement)); invaderShootingScripts = (InvaderShoot[])FindObjectsOfType(typeof(InvaderShoot)); mysteryShipMovement = GameObject.FindWithTag("MysteryShip").GetComponent <MysteryShipMovement>(); setEnemiesToInitialState(); }
void Start() { gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); mysteryShipMovement = GetComponent <MysteryShipMovement>(); mysteryShipPoints.text = ""; }