private IEnumerator TransitionScenes(ArcoTracingCollider from, ArcoTracingCollider to)
        {
            // Block Screen
            transition.BlockInteraction(true);
            // Play Audio
            AudioManager.instance.PlaySound("Right Click");
            AudioManager.instance.PlayRandomSuccessSound();
            yield return(new WaitForSeconds(1f));

            // Fade Out
            yield return(StartCoroutine(transition.FadeOut()));

            // Change Items
            from.ResetEverything();
            from.transform.parent.gameObject.SetActive(false);
            to.ResetEverything();
            to.transform.parent.gameObject.SetActive(true);
            currentTracingInfo = to.transform.parent.GetComponent <TracingInformation>();
            patetaLeft.SetActive(currentTracingInfo.PatetaOnTheLeft);
            patetaRight.SetActive(!currentTracingInfo.PatetaOnTheLeft);
            // Fade In
            yield return(StartCoroutine(transition.FadeIn()));

            // retrieve scene
            transition.BlockInteraction(false);
            yield return(StartCoroutine(PlayAudio(
                                            currentTracingInfo.IntroAudioDescription)));
        }
        private IEnumerator TransitionToPlayAgain()
        {
            yield return(StartCoroutine(screenTransition.FadeOut()));

            ResetGame();
            gameMenuFlowchart.ExecuteBlock("Start Play Again");
            // precisa chamar StopAllCoroutines?
        }
    public static void OneShotFadeTransition(float totalDuration,
                                             float blackScreenPauseDuration = 0.0f)
    {
        float            fadeDuration      = totalDuration * 0.5f;
        ScreenTransition screenTransition  = new ScreenTransition(fadeDuration);
        IEnumerator      coroutineSequence = CoroutineUtility.RunSequentially(
            screenTransition.FadeOut(),
            CoroutineUtility.WaitForRealtimeSeconds(blackScreenPauseDuration),
            screenTransition.FadeIn()
            );

        TransitionUtility.instance.StartCoroutine(
            CoroutineUtility.RunThenCallback(
                coroutineSequence,
                () => Destroy(screenTransition.panel.panel)));
    }
Exemple #4
0
        private IEnumerator UpdateScreens()
        {
            transition.BlockInteraction(true);
            AudioManager.instance.PlaySound("Right Click");
            AudioManager.instance.PlayRandomSuccessSound();
            yield return(new WaitForSeconds(1f));

            yield return(StartCoroutine(transition.FadeOut()));

            if (currentScreenIndex == screenOrder.Length)
            {
                screenManagement.SetCurrentScreenIndex(screenOrder.Length);
                screenManagement.OnCurrentScreenChanged();
                screenManagement.FocusOnCurrentScreen();
                // this is the last drum looping screen
                currentTracingInfo = screenManagement.GetCurrentScreen().GetComponent <TracingInformation>();
                fillController.UpdateTrailObject(screenManagement.GetCurrentScreen().transform, currentTracingInfo.IsLastTracing);
            }
            else
            {
                screenManagement.SetCurrentScreenIndex(screenOrder[currentScreenIndex++]);
                screenManagement.OnCurrentScreenChanged();
                screenManagement.FocusOnCurrentScreen();

                currentTracingInfo = screenManagement.GetCurrentScreen().GetComponent <TracingInformation>();
                fillController.UpdateTrailObject(screenManagement.GetCurrentScreen().transform.GetChild(0));
            }

            patetaLeft.SetActive(currentTracingInfo.PatetaOnTheLeft);
            patetaRight.SetActive(!currentTracingInfo.PatetaOnTheLeft);

            // get the info of the current screen in order to put the pateta in the right position
            yield return(StartCoroutine(transition.FadeIn()));

            transition.BlockInteraction(false);
            // Debug.Log("Playing the audio: " + currentTracingInfo.IntroAudioDescription);
            yield return(StartCoroutine(PlayAudio(currentTracingInfo.IntroAudioDescription)));
        }