1
0
forked from cgvr/DeltaVR

add some voicelines to archery range minigame

This commit is contained in:
2026-01-25 16:11:08 +02:00
parent ec45c402af
commit 24000ec80c
6 changed files with 24 additions and 12 deletions

View File

@@ -30,7 +30,6 @@ public class ArcheryRange : NetworkBehaviour
public ArcheryRangeModelGenerationController modelGenerationController;
public KeyboardManager keyboardManager;
public NPCController npcController;
private List<ArcheryTarget> _targets;
@@ -59,11 +58,6 @@ public class ArcheryRange : NetworkBehaviour
StartCoroutine(DelayedSetHighScoreText(10f)); // Cannot immediately assign these values because fishnet needs time.
}
private void Start()
{
npcController.StartTalking();
}
private System.Collections.IEnumerator DelayedSetHighScoreText(float delaySeconds)
{
yield return new WaitForSeconds(delaySeconds);

View File

@@ -19,6 +19,7 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
public Material modelDisplayActiveMaterial;
public Transform wire;
public Material wireActiveMaterial;
public NPCController npcController;
private bool modelGenerationInProgress;
private EventInstance printingSound;
@@ -56,6 +57,8 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
{
modelGenerationButton.Deactivate();
}
npcController.SpeakVoiceLine(3);
}
private async void InvokeModelGeneration()
@@ -76,6 +79,7 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
GeneratedModel = spawnedObject;
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
npcController.SpeakVoiceLine(4);
OnModelReady();
modelGenerationButton.Deactivate();

View File

@@ -8,6 +8,7 @@ public class MicrophoneStand : MonoBehaviour
public GameObject microphoneOffStatus;
public GameObject microphoneOnStatus;
public NPCController npcController;
public FMODWhisperBridge fmodWhisperBridge;
// Start is called before the first frame update
@@ -35,6 +36,7 @@ public class MicrophoneStand : MonoBehaviour
microphoneOffStatus.SetActive(false);
microphoneOnStatus.SetActive(true);
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.RadioButton, gameObject);
npcController.SpeakVoiceLine(1);
fmodWhisperBridge.ActivateRecording();
}
}
@@ -47,6 +49,7 @@ public class MicrophoneStand : MonoBehaviour
microphoneOffStatus.SetActive(true);
microphoneOnStatus.SetActive(false);
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.RadioButton, gameObject);
npcController.SpeakVoiceLine(2);
fmodWhisperBridge.DeactivateRecording();
}
}

View File

@@ -1,4 +1,5 @@
using DG.Tweening;
using System.Collections;
using Unity.XR.CoreUtils;
using UnityEngine;
@@ -13,7 +14,7 @@ public class NPCController : MonoBehaviour
public float mouthScalingMultiplier = 2.5f;
public float mouthMovementDuration = 0.25f;
public string voicelineKey;
public string[] voiceLineKeys;
// Start is called before the first frame update
void Awake()
@@ -47,9 +48,11 @@ public class NPCController : MonoBehaviour
if (controller != null)
{
playerTransform = controller.transform;
AudioManager.Instance.PlayDialogue(voiceLineKeys[0], gameObject);
} else if (playerOrigin != null)
{
playerTransform = playerOrigin.transform;
AudioManager.Instance.PlayDialogue(voiceLineKeys[0], gameObject);
}
}
@@ -67,6 +70,11 @@ public class NPCController : MonoBehaviour
}
}
public void SpeakVoiceLine(int voiceLineId)
{
AudioManager.Instance.PlayDialogue(voiceLineKeys[voiceLineId], gameObject);
}
public void StartTalking()
{
isTalking = true;