private void CheckGameState() { // Populates the arrays properly if (gameState == "intro") { if (update == false) { update = true; } } // Begins the opening narrations if (gameState == "narrate") { if (update == false) { screens.setScreen(0); whitefading.WhiteFadeAnimation(); narrator.playClip(0); audience.playClip(1); lighting.ActivateLight(1); lighting.ActivateLight(2); update = true; Slideshow = true; } if (audience.checkIfPlay() == false) { audience.playClip(9); print("test audio"); } // Moves on to the next game state when the clip ends if (narrator.soundClips[0].isPlaying == false || Input.GetKey(KeyCode.Escape)) { update = false; gameState = "narrateToGame1"; lighting.ActivateLight(5); Slideshow = false; screens.setScreen(7); print("Test 1"); } } // if (gameState == "narrateToGame1") { if (update == false) { screens.setScreen(1); narrator.playClip(1); teleport1.Activate(); update = true; playerControl.velocityModifier = 10; } } if (gameState == "Game1") { if (update == false) { Room1.SetActive(false); Room2.SetActive(true); screens = Room2.transform.GetChild(2).GetComponent <ScreenController>(); screens.GetScreens(); screens.setScreen(2); lighting = Room2.transform.GetChild(3).GetComponent <Lighting>(); lighting.GetLights(); lighting.ActivateAllLights(); playerControl.setRoom1(); update = true; Slideshow = true; } if (playerControl.victory) { gameState = "Game1toGame2"; Slideshow = false; screens.setScreen(9); audience.playNoInterruptClip(4); narrator.playClip(7); update = false; } } if (gameState == "Game1toGame2") { if (update == false) { teleport2.Activate(); update = true; } } if (gameState == "Game2") { if (update == false) { Room2.SetActive(false); Room3.SetActive(true); screens = Room3.transform.GetChild(2).GetComponent <ScreenController>(); screens.GetScreens(); screens.setScreen(2); lighting = Room3.transform.GetChild(3).GetComponent <Lighting>(); lighting.GetLights(); lighting.ActivateAllLights(); playerControl.setRoom2(); update = true; Slideshow = true; } if (playerControl.victory) { gameState = "Game2toConclusion"; Slideshow = false; screens.setScreen(9); audience.playNoInterruptClip(4); narrator.playClip(7); update = false; } } if (gameState == "Game2toConclusion") { if (update == false) { screens.setScreen(0); update = true; teleport3.Activate(); } } if (gameState == "Conclusion") { if (update == false) { Room4.SetActive(true); Room3.SetActive(false); screens = Room4.transform.GetChild(0).GetComponent <ScreenController>(); lighting = Room4.transform.GetChild(1).GetComponent <Lighting>(); screens.GetScreens(); screens.setScreen(0); lighting.GetLights(); lighting.ActivateAllLights(); update = true; Slideshow = false; screens.setScreen(9); audience.playClip(9); narrator.playClip(10); timer3 = 3.0f; } if (Input.GetKey(KeyCode.Escape)) { SceneManager.LoadScene(0, LoadSceneMode.Single); } } }