IEnumerator CutScene() { _player.SendMessage("StartCutscene"); Debug.Log("CutSceneStarted"); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Huh...? What is that?", 0.1f))); yield return(new WaitForSeconds(1f)); _player.SendMessage("DisplayText", ""); _cam.SendMessage("ChangeTarget", _target); _source.PlayOneShot(_gueSound); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Uhh...", 0.25f))); yield return(new WaitForSeconds(1f)); _cam.SendMessage("ChangeTarget", _player.transform); _victim.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I am scared...\nWhat is this place?", 0.1f))); yield return(new WaitForSeconds(0.75f)); _player.SendMessage("DisplayText", ""); yield return(StartCoroutine(_flasherWhite.Flash())); Debug.Log("CutSceneEnded"); _player.SendMessage("EndCutscene"); Destroy(gameObject); }
IEnumerator PlayCutscene() { Debug.Log("CutsceneStarted"); yield return(StartCoroutine(_flasherWhite.Flash())); yield return(StartCoroutine(_fader.FadeOut())); _cam.SendMessage("ChangeTarget", _player.transform); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(_fader.FadeIn())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ahhh...", 0.15f))); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "My head...", 0.15f))); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Where am I?", 0.15f))); yield return(new WaitForSeconds(0.55f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I was...visiting...", 0.15f))); yield return(new WaitForSeconds(0.55f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "...him...", 0.25f))); yield return(new WaitForSeconds(0.575f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Wasn't I...?", 0.15f))); yield return(new WaitForSeconds(0.55f)); _player.SendMessage("DisplayText", ""); yield return(StartCoroutine(_flasherWhite.Flash())); Debug.Log("CutSceneEnded"); _player.SendMessage("EndCutscene"); Destroy(gameObject); }
IEnumerator CutScene() { Debug.Log("CutSceneStarted"); var vrb = _victim.GetComponent <Rigidbody2D>(); var prb = _player.GetComponent <Rigidbody2D>(); _player.SendMessage("StartCutscene"); _cam.SendMessage("ChangeTarget", _target); //Glue talks _source.PlayOneShot(_gueSound); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "A human, here in this realm?\nHow funny.", 0.1f))); yield return(new WaitForSeconds(1f)); _source.PlayOneShot(_gueSound); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Your end is near, mortal.", 0.1f))); yield return(new WaitForSeconds(1f)); _victim.SendMessage("DisplayText", ""); //Glue attacks _music.SetActive(true); vrb.MovePosition(new Vector2(vrb.position.x - 0.95f, vrb.position.y)); _source.PlayOneShot(_gueAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ahh!", 0.01f))); yield return(new WaitForSeconds(0.5f)); //Cherry goes back _cam.SendMessage("ChangeTarget", _player.transform); prb.MovePosition(new Vector2(prb.position.x - 0.1f, prb.position.y)); _player.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Yes, you are going to die here!", 0.05f))); yield return(new WaitForSeconds(1f)); _victim.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "No...no...", 0.15f))); yield return(new WaitForSeconds(1f)); _isActive = true; //Decision Time yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Flee (Q)?\nFight (E)?"))); while (!_isDecided) { yield return(null); } _music.SetActive(false); if (_choosedAttack) { //Cherry Attacks yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I don't want to die!!!", 0.01f))); prb.MovePosition(new Vector2(prb.position.x + 0.15f, prb.position.y)); _source.PlayOneShot(_cherryAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Huah! Die! Die!", 0.01f))); _source.PlayOneShot(_cherryAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(new WaitForSeconds(0.5f)); _source.PlayOneShot(_cherryAttack); yield return(StartCoroutine(_flasherRed.Flash())); //Mark as Human _victim.GetComponent <SpriteRenderer>().sprite = _markHuman; _player.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Wha..? Cher...?", 0.1f))); yield return(new WaitForSeconds(0.25f)); _source.PlayOneShot(_cherryOnMark); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Ahh..uhhu..", 0.1f))); yield return(new WaitForSeconds(0.25f)); _victim.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Mark?!", 0.1f))); yield return(new WaitForSeconds(0.5f)); //Mark to Bloody Glue _victim.SendMessage("DisplayText", ""); _victim.GetComponent <SpriteRenderer>().sprite = _markGlue; yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ahhhh! Die!", 0.1f))); _source.PlayOneShot(_cherryOnMark); yield return(StartCoroutine(_flasherRed.Flash())); yield return(new WaitForSeconds(0.5f)); _source.PlayOneShot(_cherryOnMark); yield return(StartCoroutine(_flasherRed.Flash())); yield return(new WaitForSeconds(0.5f)); _source.PlayOneShot(_cherryOnMark); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); _player.SendMessage("DisplayText", ""); //Fade Out //yield return new WaitForSeconds(0.5f); _source.PlayOneShot(_markScream); yield return(StartCoroutine(_faderRed.FadeOut())); _victim.GetComponent <SpriteRenderer>().sprite = _blood; vrb.MovePosition(new Vector2(vrb.position.x + 0.3f, vrb.position.y - 0.2f)); yield return(new WaitForSeconds(3f)); yield return(StartCoroutine(_faderRed.FadeIn())); // yield return StartCoroutine(_faderRed.FadeIn()); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "It's...it's over...?", 0.25f))); yield return(new WaitForSeconds(1f)); yield return(StartCoroutine(_flasherWhite.Flash())); _player.SendMessage("DisplayText", ""); Debug.Log("CutSceneEnded"); _isActive = false; _player.SendMessage("EndCutscene"); Destroy(gameObject); } else { //Cherry dies yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I am scared.", 0.1f))); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I want to run.", 0.1f))); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "But my legs are frozen!", 0.01f))); yield return(new WaitForSeconds(0.5f)); _player.SendMessage("DisplayText", ""); yield return(StartCoroutine(CutsceneUtility.ShowText(_victim, "Muhaha", 0.1f))); yield return(new WaitForSeconds(0.5f)); _victim.SendMessage("DisplayText", ""); vrb.MovePosition(new Vector2(vrb.position.x - 0.15f, vrb.position.y)); _source.PlayOneShot(_gueAttack); yield return(StartCoroutine(_flasherRed.Flash())); _source.PlayOneShot(_gueAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ahhh."))); _source.PlayOneShot(_gueAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); _source.PlayOneShot(_gueAttack); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Uhhh."))); _player.SendMessage("DisplayText", ""); //Fade Out _source.PlayOneShot(_cherryScream); yield return(StartCoroutine(_faderRed.FadeOut())); _cam.SendMessage("ChangeTarget", _textScreen); yield return(new WaitForSeconds(2f)); _endText.SetActive(true); yield return(StartCoroutine(_faderRed.FadeIn())); _restart = true; } }
public void OnTriggerEnter2D(Collider2D collision) { StartCoroutine(CutsceneUtility.ShowText(collision.gameObject, _message)); //collision.gameObject.SendMessage("DisplayText", _message); }
IEnumerator CutScene() { Debug.Log("CutSceneStarted"); _player.SendMessage("StartCutscene"); isActive = true; _player.transform.localScale = new Vector3(-1, 1, 1); yield return(new WaitForSeconds(0.5f)); _cam.SendMessage("ChangeTarget", _target); yield return(new WaitForSeconds(2f)); _cam.SendMessage("ChangeTarget", _player.transform); _player.transform.localScale = new Vector3(1, 1, 1); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "What was that?", 0.1f))); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Did I see...him?", 0.1f))); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Where am I, dawm it!", 0.1f))); yield return(new WaitForSeconds(0.5f)); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ahh!"))); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "My head still hurts...", 0.1f))); yield return(new WaitForSeconds(0.25f)); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "!!"))); _source.PlayOneShot(_headHurt); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(_flasherRed.Flash())); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "I remember..."))); yield return(new WaitForSeconds(0.5f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_player, "Ohnononono", 0.4f))); yield return(StartCoroutine(_fader.FadeOut())); _rainMusic.SetActive(false); _player.SendMessage("DisplayText", ""); _cam.SendMessage("ChangeTarget", _textScreen.transform); yield return(new WaitForSeconds(1f)); _music.SetActive(true); yield return(StartCoroutine(_fader.FadeIn())); yield return(StartCoroutine(CutsceneUtility.ShowText(_textScreen, "Mark and I went out....\n" + "We were going to party\n" + "and party hard we did.\n" + "I remember.\n" + "Mark and I shared something.\n" + "LSD? I'm not sure.\n", 0.15f))); yield return(new WaitForSeconds(2f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_textScreen, "But I know, I definitely know...\n" + "That it is my head,\n" + "messing with me...\n" + "And that means...\n", 0.15f))); _music.SetActive(false); yield return(StartCoroutine(CutsceneUtility.ShowText(_textScreen, "I killed Mark.", 0.5f))); yield return(new WaitForSeconds(2f)); yield return(StartCoroutine(CutsceneUtility.ShowText(_textScreen, "My mind went blank.\n" + "My mind tricked me,\n" + "made me do the most monstrous\n" + "thing a human being can do.\n" + "To kill.\n" + "I am a monster, forever.", 0.15f))); yield return(new WaitForSeconds(2f)); _textScreen.SendMessage("DisplayText", ""); _music.SetActive(false); _endMessage.SetActive(true); yield return(StartCoroutine(_flasherWhite.Flash())); Debug.Log("CutSceneEnded"); isActive = false; }