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)));
        }
Beispiel #2
0
        private IEnumerator Intro()
        {
            yield return(new WaitForSeconds(1f));

            transition.BlockInteraction(true);
            currentTracingInfo = screenManagement.GetCurrentScreen().GetComponent <TracingInformation>();
            Debug.Log("Intro calling: " + currentTracingInfo.gameObject.name);
            patetaLeft.SetActive(currentTracingInfo.PatetaOnTheLeft);
            patetaRight.SetActive(!currentTracingInfo.PatetaOnTheLeft);
            // fillController.UpdateTrailObject(screenManagement.GetCurrentScreen().transform.GetChild(0));
            fillController.UpdateTrailObject(currentTracingInfo.transform.GetChild(0));
            yield return(StartCoroutine(transition.FadeIn()));

            // play audio cue
            transition.BlockInteraction(false);
            yield return(StartCoroutine(PlayAudio(currentTracingInfo.IntroAudioDescription)));
        }
        private IEnumerator IntroFadeIn()
        {
            Debug.Log("Bloqueando a Interação no começo");
            screenTransition.BlockInteraction(true);
            int index = (screenManagement.GetCurrentScreenIndex());

            currentScreenController = screenManagement.GetScreenAt(index).GetComponent <PointAndClickController>();
            itemsSelectedReference.transform.parent.gameObject.SetActive(currentScreenController.Type == PointAndClickType.FindItem);
            yield return(StartCoroutine(screenTransition.FadeIn()));

            Debug.Log("Fade in finished and we're starting the game");
            string prefix = (currentScreenController.Type == PointAndClickType.FindItem) ? "Pergunta " : "";

            yield return(StartCoroutine(PlayAudio(prefix + currentScreenController.AudioIdentifier)));

            screenTransition.BlockInteraction(false);
            Debug.Log("Desbloqueando a Interação no começo");
        }
    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)));
    }