void Update() { // Moves the Player from off screen into start position at -4.5f on the Y-axis if (_isPlayerInPosition == false) { transform.Translate(1.25f * Time.deltaTime * Vector3.up); if (transform.position.y >= -4.5f) { transform.position = new Vector3(transform.position.x, -4.5f, 0); _isPlayerInPosition = true; } if (_isPlayerInPosition == true) { StartCoroutine(ResetPlayerPosition()); } } if (_gameManager.continueToNextDifficultyLevel == true) { _spawnManager.AdvanceToNextLevel(); _gameManager.continueToNextDifficultyLevel = false; } if (_gameFirstStart == false) { CalculateMovement(); CalculateThrustersScale(); ActivateTractorBeam(); DeactivateTractorBeam(2); ThrusterCoreLogic(); if (_coreOnline == false) { StartCoroutine(LoseCore()); } if (Input.GetKeyDown(KeyCode.Space) && _hasPlayerLaserCooledDown) { PlayerFireLaser(); } } if (Input.GetKeyDown(KeyCode.M)) { if (_isPlayerHomingMissilesActivate == true && _homingMissileCount > 0) { FireHomingMissile(); } } if (_homingMissileCount == 0) { _isPlayerHomingMissilesActivate = false; } }