IEnumerator ThisIsTheEnd() { end.Play(); yield return(new WaitForSeconds(end.GetLength())); SceneManager.LoadScene("Menu"); }
IEnumerator clockingAlong() { changeClock(); // call method to change sprite narrator.Play(); yield return(new WaitForSeconds(narrator.GetLength())); door.doorUnlock = true; }
// Update is called once per frame void Update() { if (level == 5) { if (Input.GetKey(KeyCode.RightArrow)) { dir = 1; if (triggerLv5 == 1) { clipLv5.Play(); triggerLv5--; } } else if (Input.GetKey(KeyCode.LeftArrow)) { dir = -1; if (triggerLv5 == 1) { clipLv5.Play(); triggerLv5--; } } else { dir = 0; } horizontalMove = dir * runSpeed; } else { horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed; } if (level == 3 && Input.GetKeyDown(KeyCode.Space) && triggerLv3 == 1) { clipLv3.Play(); triggerLv3--; } if (Input.GetButtonDown("Jump") && jumpEnabled) { jump = true; } }
IEnumerator PauseCoroutine() { GamePause gamePause = canvas.GetComponent <GamePause>(); gamePause.Pause(); narratorTrigger.Play(); Debug.Log(narratorTrigger.GetLength()); yield return(new WaitForSecondsRealtime(narratorTrigger.GetLength())); gamePause.Resume(); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); }
private void Update() { if (player.transform.position.x <= -3 && player.transform.position.x >= -5 && player.transform.position.y <= 2.5 && player.transform.position.y >= 0) { col = true; } else { col = false; } if (Input.GetKeyDown(KeyCode.E) && col && door.level == 6) { OpenCloset(); // call method to change sprite narrator.Play(); door.doorUnlock = true; } }