Exemplo n.º 1
0
        private IEnumerator transitionToScene(string sceneName)
        {
            UiHelper.setAllButtonEnabled(navigationSelectionContainer, false);
            // Start to load next scene
            AsyncOperation ao = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Single);

            ao.allowSceneActivation = false;
            // Transition UI out
            StartCoroutine(ambientAudio.fadeOut(1));
            StartCoroutine(transitionUi(false));
            // Fade out
            yield return(StartCoroutine(Camera.main.fadeOut(2)));

            // Switch to next scene
            ao.allowSceneActivation = true;
        }