Exemplo n.º 1
0
 private IEnumerator PlaceQuestions(bool playAudio = false)
 {
     QuestionPlacer.Place(QuestionGenerator.GetAllQuestions(), playAudio);
     while (QuestionPlacer.IsAnimating())
     {
         yield return(null);
     }
 }
Exemplo n.º 2
0
        private IEnumerator DescriptionAudio()
        {
            yield return(Dialogues.PlayGameDescription());

            if (executingRound0 && AssessmentOptions.Instance.PlayQuestionAlsoAfterTutorial)
            {
                yield return(QuestionPlacer.PlayQuestionSound());
            }
        }
Exemplo n.º 3
0
        private IEnumerator ClearRound()
        {
            LogicInjector.RemoveDraggables();

            yield return(Koroutine.Nested(LogicInjector.AllAnsweredEvent()));

            QuestionPlacer.RemoveQuestions();
            AnswerPlacer.RemoveAnswers();

            while (QuestionPlacer.IsAnimating() || AnswerPlacer.IsAnimating())
            {
                yield return(null);
            }

            LogicInjector.ResetRound();
        }
Exemplo n.º 4
0
 private void Start()
 {
     placer = this.gameObject.GetComponent <QuestionPlacer>();
 }
        public IEnumerator PlayCoroutine(Action gameEndedCallback)
        {
            yield return(PlayStartSound());

            bool AnturaShowed = false;

            for (int round = 0; round < Configuration.Rounds; round++)
            {
                #region Init
                QuestionGenerator.InitRound();

                for (int question = 0; question < Configuration.SimultaneosQuestions; question++)
                {
                    LogicInjector.Wire(
                        QuestionGenerator.GetNextQuestion(),
                        QuestionGenerator.GetNextAnswers());
                }

                LogicInjector.CompleteWiring();
                LogicInjector.EnableDragOnly(); //as by new requirments

                //mute feedback audio while speaker is speaking
                bool answerConfigurationCache = AssessmentConfiguration.Instance.PronunceAnswerWhenClicked;
                AssessmentConfiguration.Instance.PronunceAnswerWhenClicked = false;

                QuestionGenerator.CompleteRound();
                #endregion

                if (AnturaShowed)
                {
                    // Show question only after antura animation is done.
                    QuestionPlacer.Place(QuestionGenerator.GetAllQuestions());
                    while (QuestionPlacer.IsAnimating())
                    {
                        yield return(null);
                    }
                }

                AnswerPlacer.Place(QuestionGenerator.GetAllAnswers());
                while (AnswerPlacer.IsAnimating())
                {
                    yield return(null);
                }

                LogicInjector.AnswersAdded();

                if (AnturaShowed == false)
                {
                    #region ANTURA ANIMATION

                    PlayAnturaIsComingSound();
                    var anturaController = AnturaFactory.Instance.SleepingAntura();

                    anturaController.StartAnimation(() => PlayPushAnturaSound(), () => PlayAnturaGoneSound());

                    while (anturaController.IsAnimating())
                    {
                        yield return(null);
                    }

                    yield return(TimeEngine.Wait(0.3f));

                    yield return(PlayGameDescription());

                    #endregion

                    QuestionPlacer.Place(QuestionGenerator.GetAllQuestions());
                    while (QuestionPlacer.IsAnimating())
                    {
                        yield return(null);
                    }

                    AnturaShowed = true;
                }

                #region GamePlay
                //////////////////////////////
                //// GAME LOGIC (WIP)
                ////----
                // Restore audio when playing
                AssessmentConfiguration.Instance.PronunceAnswerWhenClicked = answerConfigurationCache;
                LogicInjector.EnableGamePlay();

                while (LogicInjector.AllAnswersCorrect() == false)
                {
                    yield return(null);
                }
                ////___
                //// GAME LOGIC END
                //////////////////////////////

                LogicInjector.RemoveDraggables();

                QuestionPlacer.RemoveQuestions();
                AnswerPlacer.RemoveAnswers();

                while (QuestionPlacer.IsAnimating() || AnswerPlacer.IsAnimating())
                {
                    yield return(null);
                }

                LogicInjector.ResetRound();
                #endregion
            }

            gameEndedCallback();
        }