forked from cgvr/DeltaVR
moved archery range model generation logic to npc script, added corresponding voicelines
This commit is contained in:
@@ -50,7 +50,7 @@ public class CafeWaiterNPC : NPCController
|
||||
{
|
||||
SpeakVoiceLine(0);
|
||||
|
||||
fmodWhisperBridge.OnWhisperSegmentUpdated += OnPlayerSpeechUpdate;
|
||||
fmodWhisperBridge.OnWhisperSegmentUpdated += OnPlayerSpeechUpdated;
|
||||
fmodWhisperBridge.OnWhisperSegmentFinished += OnPlayerSpeechFinished;
|
||||
fmodWhisperBridge.ActivateRecording();
|
||||
|
||||
@@ -61,7 +61,7 @@ public class CafeWaiterNPC : NPCController
|
||||
|
||||
protected override void OnPlayerLeave()
|
||||
{
|
||||
fmodWhisperBridge.OnWhisperSegmentUpdated -= OnPlayerSpeechUpdate;
|
||||
fmodWhisperBridge.OnWhisperSegmentUpdated -= OnPlayerSpeechUpdated;
|
||||
fmodWhisperBridge.OnWhisperSegmentFinished -= OnPlayerSpeechFinished;
|
||||
fmodWhisperBridge.DeactivateRecording();
|
||||
|
||||
@@ -80,10 +80,6 @@ public class CafeWaiterNPC : NPCController
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (IsPlayerSpeechMeaningless(playerText))
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastPlayerVoiceUpdateTime = Time.time;
|
||||
|
||||
if (state == 1)
|
||||
@@ -111,12 +107,8 @@ public class CafeWaiterNPC : NPCController
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPlayerSpeechUpdate(string playerText)
|
||||
private void OnPlayerSpeechUpdated(string playerText)
|
||||
{
|
||||
if (IsPlayerSpeechMeaningless(playerText))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Only update notepad text when currently listening to player order
|
||||
if (state == 1)
|
||||
{
|
||||
@@ -124,10 +116,7 @@ public class CafeWaiterNPC : NPCController
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsPlayerSpeechMeaningless(string playerText)
|
||||
{
|
||||
return string.IsNullOrEmpty(playerText) || playerText.Contains("BLANK_AUDIO") || playerText.Trim().Equals("[ Silence ]");
|
||||
}
|
||||
|
||||
|
||||
private async void BringFood()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user