Exemplo n.º 1
0
        void OnQuestionAudioComplete()
        {
            DisableEggButtonsInput();

            game.eggController.EmoticonClose();

            game.SetCurrentState(game.PlayState);
        }
Exemplo n.º 2
0
        public void Update(float delta)
        {
            if (toNextState)
            {
                nextStateTimer -= delta;

                if (nextStateTimer <= 0f)
                {
                    toNextState = false;

                    if (!showTutorial)
                    {
                        if (game.stagePositiveResult)
                        {
                            game.correctStages++;

                            ILivingLetterData runLetterData;
                            runLetterData = game.questionManager.GetlLetterDataSequence()[0];
                            game.runLettersBox.AddRunLetter(runLetterData);
                        }

                        game.Context.GetOverlayWidget().SetStarsScore(game.CurrentStars);
                        game.currentStage++;
                        game.antura.NextStage();
                    }

                    game.SetCurrentState(game.ResultState);
                }
            }

            inputButtonTimer -= delta;

            if (progressInput)
            {
                PlayPositiveAudioFeedback();
                game.eggController.EmoticonPositive();
                game.eggController.StartShake();
                game.eggController.ParticleCorrectEnabled();

                progressInput = false;
                if (inputButtonTimer >= 0)
                {
                    inputButtonCount++;
                }
                else
                {
                    inputButtonCount = 0;
                }

                if (inputButtonCount >= inputButtonMax)
                {
                    inputButtonCount = 0;
                    PositiveFeedback();
                }

                tutorialDelayTimer = 0.5f;

                inputButtonTimer = inputButtonTime;
            }

            if (showTutorial && !tutorialStop)
            {
                if (tutorialCorrectActive)
                {
                    tutorialCorrectTimer -= delta;
                    if (tutorialCorrectTimer <= 0f)
                    {
                        if (isSequence)
                        {
                            tutorialSequenceIndex++;
                            if (tutorialSequenceIndex < correctAnswers)
                            {
                                tutorialCorrectTimer = 1f;

                                Vector3 clickPosition = game.eggButtonBox.GetButtons(false)[tutorialSequenceIndex].transform.position;
                                TutorialUI.Click(clickPosition);
                            }
                            else
                            {
                                tutorialCorrectActive = false;
                                tutorialDelayTimer    = tutorialDelayTime;
                            }
                        }
                        else
                        {
                            tutorialCorrectActive = false;
                            tutorialDelayTimer    = tutorialDelayTime;
                        }
                    }
                }
                else
                {
                    tutorialDelayTimer -= delta;

                    if (tutorialDelayTimer <= 0f)
                    {
                        TutorialPressCorrect();
                    }
                }
            }
        }