Ejemplo n.º 1
0
        private IEnumerator LoadUnloadFacebookSceneCoroutine(bool load)
        {
            if (load)
            {
                player.movementEnabled = false;
            }

            yield return(StartCoroutine(cameraManager.FadeInCoroutine()));

            if (load)
            {
                SceneManager.LoadScene("FacebookConversation", LoadSceneMode.Additive);
                RpgManager.CameraManager.ChangeCameraOutputSize(0.5f);
                yield return(StartCoroutine(cameraManager.FadeOutCoroutine()));
            }
            else
            {
                AsyncOperation ao = Instance.unloadingFacebook = SceneManager.UnloadSceneAsync("FacebookConversation");
                yield return(new WaitUntil(() => ao.isDone));

                CameraManager.ChangeCameraOutputSize(1.0f);
                yield return(StartCoroutine(cameraManager.FadeOutCoroutine()));

                RpgManager.OnEndUnloadingFacebook();
            }
        }