/*public void playCutscene(int idx) * { * if (idx < cutscenes.Length) { * //Instantiate(cutscenes[idx]); * pause(); * } * }*/ public IEnumerator playCutscene(int idx) { if (idx <= cutscenes.Length) { StartCoroutine(FadeIn(cutscenes[idx - 1])); AkSoundEngine.PostEvent("Trigger_Memory_Full_" + flag, getCurrentMemory().gameObject); pause(); yield return(new WaitUntil(() => controls.getADown())); StartCoroutine(FadeOut(cutscenes[idx - 1])); print("playing Cutscene"); } yield return(null); camera.GetComponent <CameraPan>().SetPlayCutscence(true); yield return(new WaitForSeconds(7)); camera.GetComponent <CameraPan>().SetPlayCutscence(false); yield return(new WaitForSeconds(7)); camera.GetComponent <CameraZoom>().turnOnOff(true); camera.GetComponent <CinemachineVirtualCamera>().Follow = player.transform; unpause(); yield return(null); }
IEnumerator displayTutorialButtons() { yield return(new WaitForSeconds(2)); StartCoroutine(FadeOut(fader)); yield return(new WaitForSeconds(3)); //Spawn in Trigger button prompt StartCoroutine(FadeIn(triggerPrompt)); yield return(new WaitUntil(() => controls.getRightTriggerDown())); //Change color of trigger button prompt yield return(new WaitForSeconds(4)); //Spawn in Analog stick prompt yield return(new WaitForSeconds(1)); StartCoroutine(FadeIn(analogPrompt)); yield return(new WaitUntil(() => controls.getRightTrigger() && (controls.getLeftStickX() > Mathf.Abs(0.5f) || controls.getLeftStickY() > Mathf.Abs(0.5f)))); //Change color of analog stick prompt yield return(new WaitForSeconds(10)); StartCoroutine(FadeOut(triggerPrompt)); StartCoroutine(FadeOut(analogPrompt)); yield return(new WaitForSeconds(1)); StartCoroutine(FadeIn(neuronPrompt)); yield return(new WaitForSeconds(3)); neuron.SetActive(true); //Spawn in start button yield return(new WaitUntil(() => neuron.GetComponent <Neuron>().activated)); StartCoroutine(FadeOut(neuronPrompt)); yield return(new WaitForSeconds(3)); StartCoroutine(FadeIn(startPrompt)); yield return(new WaitUntil(() => controls.getADown())); StartCoroutine(FadeIn(fader)); yield return(new WaitForSeconds(2)); SceneManager.LoadScene(2); yield return(null); }