コード例 #1
0
ファイル: PlayerController.cs プロジェクト: ST3ALth/Play
    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);
    }
コード例 #2
0
ファイル: PlayerController.cs プロジェクト: bmwalters/Play
    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);
    }
コード例 #3
0
    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);
        }
    }