void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { waiting = true; fade.FadeOut(); GetComponent <AudioSource>().Play(); Hitstop.current.HitstopFor(2); lev_con = FindObjectOfType <LevelController>(); } }
// Update is called once per frame void Update() { currentTime += (Time.deltaTime / gameLengthInSeconds) * daySpeed; //print(currentTime); int idx = (int)Mathf.Floor(currentTime * clock.Length); if (idx < clock.Length) { clockImage.sprite = clock[idx]; } if (currentTime >= 1 && !dayEnded) { dayEnded = true; print("Day Ends"); ftb.FadeOut(); StartCoroutine(NextDay()); } }
private IEnumerator SwitchSceneCrt() { yield return(fader.FadeOut()); SceneManager.LoadScene(scene, LoadSceneMode.Single); }
private IEnumerator RespawnCrt() { yield return(StartCoroutine(fader.FadeOut())); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }