Exemplo n.º 1
0
    private IEnumerator LoadNextScene()
    {
        // Fade the screen from black to white
        // Disable player controls when loading
        UIFade.instance.FadeToBlack();
        PlayerController.instance.sceneTransitionFrom = sceneTransitionFrom;
        PlayerController.instance.isLoading           = true;
        gameMenu.DisableControl(true);
        yield return(new WaitForSeconds(loadTimer));

        SceneManager.LoadScene(sceneToLoad);
        UIFade.instance.FadeFromBlack();
        PlayerController.instance.isLoading = false;
        gameMenu.DisableControl(false);
    }