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 NextFinalScene()
        {
            // 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
            scenes.GetChildrenIndex(currentIndex - 1).ResetEverything();
            scenes.GetChildrenIndex(currentIndex - 1).transform.parent.
            gameObject.SetActive(false);
            lastScene.ResetEverything();
            lastScene.transform.parent.gameObject.SetActive(true);
            currentTracingInfo = lastScene.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 Intro()
        {
            yield return(new WaitForSeconds(.125f));

            currentTracingInfo = scenes.GetChildrenIndex(currentIndex).
                                 transform.parent.GetComponent <TracingInformation>();
            patetaLeft.SetActive(currentTracingInfo.PatetaOnTheLeft);
            patetaRight.SetActive(!currentTracingInfo.PatetaOnTheLeft);
            yield return(StartCoroutine(
                             PlayAudio(currentTracingInfo.IntroAudioDescription)));
        }
Exemple #4
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)));
        }
Exemple #5
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)));
        }