1
0
forked from cgvr/DeltaVR

archery range npc voicelines for completing round and submitting name

This commit is contained in:
2026-03-16 15:32:46 +02:00
parent 439094f74a
commit 6a77893ed7
14 changed files with 1148 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ public class ArcheryRangeNPC : NPCController
public ModelDisplay modelDisplay;
public float modelDisplaySize = 0.75f;
public Transform startTargetQuestMarkerPoint;
public KeyboardManager keyboardManager;
private Texture2D GeneratedTexture;
@@ -25,6 +26,8 @@ public class ArcheryRangeNPC : NPCController
// 3 - player pressed the image generation button
// 4 - player pressed the model generation button
// 5 - model spawned into the game
// 6 - round completed
// 7 - name submitted
private int state;
private void Awake()
@@ -37,6 +40,8 @@ public class ArcheryRangeNPC : NPCController
microphoneStand.OnPlayerUsedMicrophone += OnPlayerUsedMicrophone;
imageGenerationButton.OnButtonPressed += OnImageGenerationButtonPressed;
modelGenerationButton.OnButtonPressed += OnModelGenerationButtonPressed;
keyboardManager.OnActivate += OnRoundComplete;
keyboardManager.OnSubmit += OnNameSubmitted;
}
protected async override void OnPlayerApproach()
@@ -119,4 +124,23 @@ public class ArcheryRangeNPC : NPCController
modelGenerationButton.Deactivate();
}
private void OnRoundComplete()
{
if (state == 5)
{
state = 6;
SpeakVoiceLine(6);
}
}
private void OnNameSubmitted()
{
if (state == 6)
{
state = 7;
}
SpeakVoiceLine(7);
}
}