public void Enter() { // Enable controls control = true; shipCamJib.SetControl(true); // Show help screen for first-time entry if (firstEntry) { flightHelp.ToggleShow(true); firstEntry = false; } // Change camera background colour Camera shipCam = shipCamJib.GetComponentInChildren <Camera>(); Sun sun = FindObjectOfType <Sun>(); shipCam.backgroundColor = sun.GetSkyColour(transform.position); sun.ChangeCamera(shipCam); // Enable scene shift shipCamJib.GetComponentInChildren <SceneShift>().enabled = true; // Enable ambient particles spaceParticles.Play(); // Clean up bullets StopCoroutine("CleanProjectiles"); StartCoroutine(CleanProjectiles(projectileCleanDelay)); }
public void SpawnPlayer(Transform spawnPoint) { GameObject currentPlayer = Instantiate(playerPrefab, spawnPoint.position, spawnPoint.rotation); // Change camera background colour Camera playerCam = currentPlayer.GetComponentInChildren <Camera>(); Sun sun = FindObjectOfType <Sun>(); playerCam.backgroundColor = sun.GetSkyColour(spawnPoint.position); sun.ChangeCamera(playerCam); }