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(); }; }
void OnAnswered(CircleButton button) { bool result = button.Answer == correct; game.Context.GetAudioManager().PlaySound(result ? Sfx.OK : Sfx.KO); if (!TutorialMode) { game.Context.GetLogManager().OnAnswered(correct, result); } if (button.Answer == correct) { // Assign score if (!TutorialMode) { game.AddScore((int)(ReadTime) + 1); game.radialWidget.percentage = 0; game.radialWidget.pulsing = false; } game.StartCoroutine(DoEndAnimation(true, correctButton)); game.antura.Mood = ReadingGameAntura.AnturaMood.HAPPY; } else { if (TutorialMode) { //button.SetColor(UnityEngine.Color.red); if (box.IsReady()) { TutorialUI.MarkNo(button.transform.position); } } else { if (!TutorialMode) { game.radialWidget.PoofAndHide(); } game.StartCoroutine(DoEndAnimation(false, correctButton)); game.antura.animator.DoShout(() => { ReadingGameConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.DogBarking); }); } } }
public void EnterState() { Finished = false; game.antura.AllowSitting = false; game.isTimesUp = false; gameTime.Reset(game.TimeToAnswer); if (!TutorialMode) { countdownCo = game.StartCoroutine(CountdownSFXCO()); } game.circleBox.SetActive(true); box = game.circleBox.GetComponent <CircleButtonBox>(); box.Clear(); correctLLData = game.CurrentQuestion.GetCorrectAnswers().First(); var wrongs = game.CurrentQuestion.GetWrongAnswers(); var choices = new List <ILivingLetterData>(); // Difficulty for game type ReadAndListen int maxWrongs = Mathf.RoundToInt(2 + 3 * game.Difficulty); choices.AddRange(wrongs); for (int i = maxWrongs, count = choices.Count; i < count; ++i) { choices.RemoveAt(choices.Count - 1); } choices.Add(correctLLData); choices.Shuffle(); float delay = 0; foreach (var c in choices) { var imageData = new LL_ImageData(c.Id); var button = box.AddButton(imageData, OnAnswered, delay); delay += 0.2f; if (c == correctLLData) { correctButton = button; } } box.Active = true; if (!TutorialMode) { if (showOldTimer) { game.radialWidget.Show(); game.radialWidget.Reset(ReadTime / MaxTime); game.radialWidget.inFront = true; game.radialWidget.pulsing = true; } gameTime.Start(); } if (ReadingGameConfiguration.Instance.CurrentGameType == ReadingGameConfiguration.GameType.ReadAndListen) { game.EnableRepeatPromptButton(); } }