public void CalcCurSentence() { m_Status = Status.SentenceCalcAnimation; bool correct = false; switch (m_CurGroup.Type) { case SentenceType.Common: m_TapCreator.Delete(); correct = m_InputCheck.CalcSentence(m_CurrentSentenceIndex + BossSentenceOffset, true); if (!correct) { BossBeatPlayer(); return; } else { m_SentenceCheckResult = RuntimeConst.BossWarWin; } break; case SentenceType.Voice: m_SentenceCheckResult = m_VoiceCheck.CalculateResult(); m_VoiceCheck.Close(); m_VoiceCheck.StopListen(); if (m_CurrentSentenceIndex < CorePlayData.CurrentSong.StreamSentences.Count - 1) { if (CorePlayData.CurrentSong.StreamSentences[m_CurrentSentenceIndex + 1].Type != SentenceType.Voice) { CorePlayManager.Instance.VoiceUIFadeOut(); } } else { CorePlayManager.Instance.VoiceUIFadeOut(); } RepeatVoice(); if (m_SentenceCheckResult == RuntimeConst.BossWarLose) { BossBeatPlayer(); return; } break; } CheckGroupType(); }
void CalcOneSentence() { switch (m_CurrentStreamSentence.Type) { case SentenceType.NonRhythmCommon: //无节奏 单词 m_TapCreator.Delete(); m_InputCheck.CalcSentence(m_CurSentenceIndex + SentenceIndexOffset); m_CurSentenceIndex++; StartCurSentence(); break; case SentenceType.NonRhythmVoice: //无节奏 语音 if (!m_GetVoice) { CorePlayManager.Instance.ComboBreak(false); } if (m_CurSentenceIndex < CorePlayData.CurrentSong.NonRhythmSenteces.Count - 1) { if (CorePlayData.CurrentSong.NonRhythmSenteces[m_CurSentenceIndex + 1].Type != SentenceType.NonRhythmVoice) { CorePlayManager.Instance.VoiceUIFadeOut(); } } else { CorePlayManager.Instance.VoiceUIFadeOut(); } m_CheckFinished = true; XunFeiSRManager.Instance.StopListen(); AudioController.SetGlobalVolume(1f); MicManager.Instance.StopRecord(); RepeatVoice(m_CurrentStreamSentence); break; } }
IEnumerator SentenceCheck(int sentenceIndex, float duration) { yield return(new WaitForSeconds(duration)); m_InputCheck.CalcSentence(sentenceIndex); }