예제 #1
0
        private void SimonSongStartQuestion(ReadingGameGame.SimonSongBPM songBPM)
        {
            game.Context.GetAudioManager().PlayDialogue(LocalizationDataId.Song_Word_Question, keeperMode: KeeperMode.SubtitlesOnly, isKeeper: false);

            game.ChangeLoopingSong(songBPM.song);
            game.StartCoroutine(ShowAnimationLetters(songBPM));
            game.StartCoroutine(SimonSongShowButtons(songBPM));

            // Question song
            game.onSongLoop += () => {
                Debug.Log("END QUESTION LOOP");
                game.StopLoopingSong();
            };
        }
예제 #2
0
        IEnumerator DoEndAnimation(bool correct, CircleButton correctButton, CircleButton clickedButton = null)
        {
            Finished   = true;
            box.Active = false;
            game.StartCoroutine(game.gameLettersHandler.CleanupCO(correct));
            if (countdownCo != null)
            {
                game.StopCoroutine(countdownCo);
            }

            if (ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.ReadAndListen)
            {
                if (!TutorialMode)
                {
                    if (correct)
                    {
                        game.AddScore(1);
                    }
                }
            }

            if (ReadingGameConfiguration.Instance.CurrentGameType != ReadingGameConfiguration.GameType.SimonSong)
            {
                yield return(new WaitForSeconds(1.0f));
            }

            if (ReadingGameConfiguration.Instance.CurrentGameType != ReadingGameConfiguration.GameType.ReadAndListen)
            {
                if (!correct && game.RemoveLife())
                {
                    yield break;
                }
            }

            if (ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.SimonSong)
            {
                // Time up
                if (!correct && !clickedButton)
                {
                    game.circleBox.GetComponent <CircleButtonBox>().ClearButtonsApartFrom(correctButton);
                }
                else
                {
                    if (correct)
                    {
                        game.AddScore(1);
                    }
                    else
                    {
                        clickedButton?.SetColor(Color.red);
                        yield return(new WaitForSeconds(0.5f));
                    }
                    correctButton.SetColor(Color.green);
                    game.circleBox.GetComponent <CircleButtonBox>().Clear(startDelay: 0.5f);
                }

                game.Context.GetAudioManager().PlayVocabularyData(correctButton.Answer);
                game.ChangeLoopingSong(game.CurrentSongBPM.intro);
                Debug.Log("POST ANSWER INTRO LOOP");
                game.onSongLoop += () =>
                {
                    KeeperManager.I.CloseSubtitles();
                    Debug.Log("END - POST ANSWER INTRO LOOP");
                    game.StopLoopingSong();
                    game.SetCurrentState(game.QuestionState);
                };
            }
            else if (ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.SimonSong)
            {
                game.circleBox.GetComponent <CircleButtonBox>().ClearButtonsApartFrom(correctButton);
                game.circleBox.GetComponent <CircleButtonBox>().Clear(() => {
                    game.SetCurrentState(game.QuestionState);
                }, 0.5f);
            }
            else
            {
                //if (!correct) clickedButton?.SetColor(Color.red);
                correctButton.SetColor(Color.green);
                game.circleBox.GetComponent <CircleButtonBox>().Clear(() => {
                    game.SetCurrentState(game.QuestionState);
                }, 0.5f);
            }
        }