protected void UpdateForward() { for (int i = 0; i < targetBlendValues.Length; ++i) { targetBlendValues[i] = 0.0f; } if (recognizeResult != null) { targetBlendValues[vowelToIndexDict[recognizeResult]] = 1.0f; } blendValuesSum = 0.0f; for (int j = 0; j < currentBlendValues.Length; ++j) { blendValuesSum += currentBlendValues[j]; } for (int k = 0; k < currentBlendValues.Length; ++k) { if (propertyIndexs[k] != -1) { currentBlendValues[k] = Mathf.MoveTowards(currentBlendValues[k], targetBlendValues[k], moveTowardsSpeed * Time.deltaTime); targetBlendShapeObject.SetBlendShapeWeight(propertyIndexs[k], Mathf.Lerp(propertyMinValue, propertyMaxValue, currentBlendValues[k])); } } visualization.Update(runtimeRecognizer.playingAudioSpectrum); if (recognizeText) { recognizeText.text = "RecognizeResult: " + recognizeResult; } }
protected virtual void UpdateForward() { // 更新左上角的音频频谱 if (visualization != null) { visualization.Update(runtimeRecognizer.playingAudioSpectrum); } // 显示识别结果 if (recognizeText) { recognizeText.text = "RecognizeResult: " + recognizeResult; } }