IEnumerator LoadLevel(string sceneName) { SceneTransAnimator.SetTrigger("Start"); yield return(new WaitForSeconds(TransitionTime)); PlayerSingleton.instance.state = PlayerSingleton.nextState(PlayerSingleton.instance.state); SceneManager.LoadScene(exitScene, LoadSceneMode.Single); }
IEnumerator OnAllTaskFinished() { Debug.Log("all task finished"); // exit scene SceneTransAnimator.SetTrigger("Start"); yield return(new WaitForSeconds(TransitionTime)); Cursor.lockState = CursorLockMode.Locked; PlayerSingleton.instance.state = PlayerSingleton.nextState(PlayerSingleton.instance.state); SceneManager.LoadScene("Demo_Real_Office", LoadSceneMode.Single); }