1
0
forked from cgvr/DeltaVR

shape detection npc speaks from radio, avoid interrupting voicelines

This commit is contained in:
2026-02-13 17:01:16 +02:00
parent c07fb1fe1e
commit 1f632c60bc
3 changed files with 17 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ public class ShapeDetectionNPC : NPCController
public Texture2D GeneratedTexture { get; private set; }
public Image imageDisplay;
public ShapeScanner shapeScanner;
public float radioAmount = 1f;
public GameObject GeneratedModel { get; private set; }
public Transform modelSpawnPoint;
@@ -79,10 +80,14 @@ public class ShapeDetectionNPC : NPCController
{
if (state == 1)
{
SpeakVoiceLine(0);
SpeakVoiceLine(0, radio.gameObject, radioAmount);
await Task.Delay(2000);
SpeakVoiceLine(1);
Invoke(nameof(CallPlayer), 4f);
// Has the player maybe picked up the radio during the last 2 seconds?
if (state == 1)
{
SpeakVoiceLine(1, radio.gameObject, radioAmount);
Invoke(nameof(CallPlayer), 4f);
}
}
}
@@ -90,7 +95,7 @@ public class ShapeDetectionNPC : NPCController
{
if (state == 1)
{
SpeakVoiceLine(2);
SpeakVoiceLine(2, radio.gameObject, radioAmount);
state = 2;
await Task.Delay(5000);
questMarker.MoveTo(microphoneStand.transform);
@@ -102,7 +107,7 @@ public class ShapeDetectionNPC : NPCController
{
if (state == 2)
{
SpeakVoiceLine(3);
SpeakVoiceLine(3, radio.gameObject, radioAmount);
state = 3;
questMarker.MoveTo(imageGenerationButton.transform);
}
@@ -119,7 +124,7 @@ public class ShapeDetectionNPC : NPCController
imageGenerationButton.Deactivate();
if (state == 3)
{
SpeakVoiceLine(4);
SpeakVoiceLine(4, radio.gameObject, radioAmount);
state = 4;
questMarker.MoveTo(modelGenerationButton.transform);
modelGenerationButton.Deactivate();
@@ -130,7 +135,7 @@ public class ShapeDetectionNPC : NPCController
{
if (state == 4)
{
SpeakVoiceLine(5);
SpeakVoiceLine(5, radio.gameObject, radioAmount);
state = 5;
questMarker.MoveTo(shapeScanner.transform);
}