void Start() { // Sets the _uIController to the script on the "Canvas" object _uIController = GameObject.Find("Canvas").GetComponent <UIController>(); // Get the _spawnController script to change variables _spawnController = GameObject.Find("Spawn_Controller").GetComponent <SpawnController>(); }
private void Start() { //Set Cursor to not be visible Cursor.visible = false; // Initialize the _uiController variable _uiController = GameObject.Find("Canvas").GetComponent <UIController>(); // Initialize the _spawnController variable _spawnController = GameObject.Find("Spawn_Controller").GetComponent <SpawnController>(); // Get audio source on this object _audioSource = GetComponent <AudioSource>(); // Change global audio setting AudioListener.volume = 1f; // Set the _pauseAnimator variable to the script on the "Pause_Menu_Panel" object _pauseAnimator = GameObject.Find("Pause_Menu_Panel").GetComponent <Animator>(); // Make the _pauseAnimator disregard Time.timeScale freezing _pauseAnimator.updateMode = AnimatorUpdateMode.UnscaledTime; }
void Start() { // Reset this variable when the player spawns GameManager._bossSpawner = 600; // Current position = new position transform.position = new Vector3(0, 0, 0); // Sets the _uIController to the script on the "Canvas" object _uIController = GameObject.Find("Canvas").GetComponent <UIController>(); // Sets the _gameManager to the script on the "GameManager" object _gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); // Sets the _spawnManager to the script on the "Spawn_Controller" object _spawnManager = GameObject.Find("Spawn_Controller").GetComponent <SpawnController>(); // Play the normal thruster sound _normalThrusterSound.gameObject.SetActive(true); // Set normal thruster active _normalThruster.gameObject.SetActive(true); // Set hit counter to 0 when game restarts _hitCounter = 0; // Reset randomNumOnce variable setRandomNumOnce = true; // If there is a Spawn Manager script then if (_spawnManager != null) { // Start spawn routines again to start the game again _spawnManager.InitializeSpawnRoutines(); } }