private void OnSentenceEnded() { List <RecordedNote> recordedNotes = PlayerNoteRecorder.GetRecordedNotes(CurrentSentence); SentenceRating sentenceRating = PlayerScoreController.CalculateScoreForSentence(CurrentSentence, recordedNotes); playerUiController.ShowTotalScore((int)PlayerScoreController.TotalScore); if (sentenceRating != null) { playerUiController.ShowSentenceRating(sentenceRating); if (sentenceRating == SentenceRating.Perfect) { perfectSentenceChain++; } else { perfectSentenceChain = 0; } if (perfectSentenceChain >= 2) { playerUiController.CreatePerfectSentenceEffect(); } } sentenceIndex++; UpdateSentences(sentenceIndex); }
private void OnSentenceEnded() { PlayerNoteRecorder.OnSentenceEnded(); List <RecordedNote> recordedNotes = PlayerNoteRecorder.GetRecordedNotes(CurrentSentence); SentenceRating sentenceRating = PlayerScoreController.CalculateScoreForSentence(CurrentSentence, recordedNotes); playerUiController.ShowTotalScore(PlayerScoreController.TotalScore); if (sentenceRating != null) { playerUiController.ShowSentenceRating(sentenceRating); sentenceRatingStream.OnNext(sentenceRating); } sentenceIndex++; UpdateSentences(sentenceIndex); }
private void FinishRecordingSentence(int sentenceIndex) { PlayerNoteRecorder.OnSentenceEnded(); Sentence recordingSentence = GetSentence(sentenceIndex); if (recordingSentence == null) { return; } List <RecordedNote> recordedNotes = PlayerNoteRecorder.GetRecordedNotes(recordingSentence); PlayerNoteRecorder.RemoveRecordedNotes(recordingSentence); SentenceRating sentenceRating = PlayerScoreController.CalculateScoreForSentence(recordingSentence, recordedNotes); playerUiController.ShowTotalScore(PlayerScoreController.TotalScore); if (sentenceRating != null) { playerUiController.ShowSentenceRating(sentenceRating); sentenceRatingStream.OnNext(sentenceRating); } }