forked from cgvr/DeltaVR
shape detection npc speaks from radio, avoid interrupting voicelines
This commit is contained in:
@@ -146,8 +146,7 @@ public abstract class NPCController : MonoBehaviour
|
||||
|
||||
protected virtual void OnPlayerLeave() {}
|
||||
|
||||
|
||||
public void SpeakVoiceLine(int voiceLineId)
|
||||
public void SpeakVoiceLine(int voiceLineId, GameObject emitter = null, float radioAmount = 0f)
|
||||
{
|
||||
if (voiceLineId < 0 || voiceLineId >= voiceLineKeys.Length)
|
||||
{
|
||||
@@ -163,7 +162,8 @@ public abstract class NPCController : MonoBehaviour
|
||||
|
||||
LoadCurve(key); // load RMS data
|
||||
|
||||
currentVoicelineEvent = AudioManager.Instance.PlayDialogue(characterSpecificFolder + "/" + key, gameObject);
|
||||
emitter = emitter ?? gameObject;
|
||||
currentVoicelineEvent = AudioManager.Instance.PlayDialogue(characterSpecificFolder + "/" + key, emitter, radioAmount);
|
||||
if (!currentVoicelineEvent.isValid())
|
||||
{
|
||||
Debug.LogError("Failed to start dialogue event.");
|
||||
|
||||
Reference in New Issue
Block a user