forked from cgvr/DeltaVR
archery range npc voicelines for completing round and submitting name
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user