forked from cgvr/DeltaVR
NPCs move quest marker around to next objectives
This commit is contained in:
@@ -20,6 +20,7 @@ public class ArcheryRange : NetworkBehaviour
|
|||||||
public Transform targetEndPosition;
|
public Transform targetEndPosition;
|
||||||
public GameObject targetPrefab;
|
public GameObject targetPrefab;
|
||||||
public StartTarget startTarget;
|
public StartTarget startTarget;
|
||||||
|
public QuestMarker questMarker;
|
||||||
|
|
||||||
public GameObject archeryTargetPointsText;
|
public GameObject archeryTargetPointsText;
|
||||||
|
|
||||||
@@ -210,6 +211,8 @@ public class ArcheryRange : NetworkBehaviour
|
|||||||
_roundEndTime = Time.time + roundLength;
|
_roundEndTime = Time.time + roundLength;
|
||||||
_nextTargetTime = Time.time;
|
_nextTargetTime = Time.time;
|
||||||
_roundActive = true;
|
_roundActive = true;
|
||||||
|
|
||||||
|
questMarker.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddScore(float distance)
|
public void AddScore(float distance)
|
||||||
|
|||||||
Binary file not shown.
@@ -7,11 +7,13 @@ using System.Threading.Tasks;
|
|||||||
public class ArcheryRangeNPC : NPCController
|
public class ArcheryRangeNPC : NPCController
|
||||||
{
|
{
|
||||||
[Header("Archery Range Config")]
|
[Header("Archery Range Config")]
|
||||||
|
public QuestMarker questMarker;
|
||||||
public MicrophoneStand microphoneStand;
|
public MicrophoneStand microphoneStand;
|
||||||
public PushableButton imageGenerationButton;
|
public PushableButton imageGenerationButton;
|
||||||
public PushableButton modelGenerationButton;
|
public PushableButton modelGenerationButton;
|
||||||
public Image imageDisplay;
|
public Image imageDisplay;
|
||||||
public ModelDisplay modelDisplay;
|
public ModelDisplay modelDisplay;
|
||||||
|
public Transform startTarget;
|
||||||
|
|
||||||
private Texture2D GeneratedTexture;
|
private Texture2D GeneratedTexture;
|
||||||
private EventInstance printingSound;
|
private EventInstance printingSound;
|
||||||
@@ -44,11 +46,14 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
{
|
{
|
||||||
if (state == 0)
|
if (state == 0)
|
||||||
{
|
{
|
||||||
|
questMarker.gameObject.SetActive(false);
|
||||||
SpeakVoiceLine(0);
|
SpeakVoiceLine(0);
|
||||||
await Task.Delay(2000);
|
await Task.Delay(2000);
|
||||||
SpeakVoiceLine(1);
|
SpeakVoiceLine(1);
|
||||||
await Task.Delay(6500);
|
await Task.Delay(6500);
|
||||||
SpeakVoiceLine(2);
|
SpeakVoiceLine(2);
|
||||||
|
questMarker.gameObject.SetActive(true);
|
||||||
|
questMarker.MoveTo(microphoneStand.transform);
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
|
|
||||||
state = 1;
|
state = 1;
|
||||||
@@ -65,6 +70,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(3);
|
SpeakVoiceLine(3);
|
||||||
|
questMarker.MoveTo(imageGenerationButton.transform);
|
||||||
state = 2;
|
state = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,6 +93,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
{
|
{
|
||||||
modelGenerationButton.Deactivate();
|
modelGenerationButton.Deactivate();
|
||||||
SpeakVoiceLine(4);
|
SpeakVoiceLine(4);
|
||||||
|
questMarker.MoveTo(modelGenerationButton.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +116,7 @@ public class ArcheryRangeNPC : NPCController
|
|||||||
if (state == 4)
|
if (state == 4)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(5);
|
SpeakVoiceLine(5);
|
||||||
|
questMarker.MoveTo(startTarget);
|
||||||
state = 5;
|
state = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ using UnityEngine.UI;
|
|||||||
public class ShapeDetectionNPC : NPCController
|
public class ShapeDetectionNPC : NPCController
|
||||||
{
|
{
|
||||||
[Header("Shape Detection Minigame Config")]
|
[Header("Shape Detection Minigame Config")]
|
||||||
|
public QuestMarker questMarker;
|
||||||
public MicrophoneStand microphoneStand;
|
public MicrophoneStand microphoneStand;
|
||||||
public RadioTransmitter radio;
|
public RadioTransmitter radio;
|
||||||
public PushableButton imageGenerationButton;
|
public PushableButton imageGenerationButton;
|
||||||
public PushableButton modelGenerationButton;
|
public PushableButton modelGenerationButton;
|
||||||
public Texture2D GeneratedTexture { get; private set; }
|
public Texture2D GeneratedTexture { get; private set; }
|
||||||
public Image imageDisplay;
|
public Image imageDisplay;
|
||||||
|
public ShapeScanner shapeScanner;
|
||||||
|
|
||||||
public GameObject GeneratedModel { get; private set; }
|
public GameObject GeneratedModel { get; private set; }
|
||||||
public Transform modelSpawnPoint;
|
public Transform modelSpawnPoint;
|
||||||
@@ -55,6 +57,8 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
state = 1;
|
state = 1;
|
||||||
await CallPlayer();
|
await CallPlayer();
|
||||||
|
await Task.Delay(2500);
|
||||||
|
questMarker.MoveTo(radio.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,12 +86,14 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPlayerPickedUpRadio()
|
private async void OnPlayerPickedUpRadio()
|
||||||
{
|
{
|
||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
SpeakVoiceLine(2);
|
SpeakVoiceLine(2);
|
||||||
state = 2;
|
state = 2;
|
||||||
|
await Task.Delay(5000);
|
||||||
|
questMarker.MoveTo(microphoneStand.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +104,7 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
SpeakVoiceLine(3);
|
SpeakVoiceLine(3);
|
||||||
state = 3;
|
state = 3;
|
||||||
|
questMarker.MoveTo(imageGenerationButton.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +121,7 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
SpeakVoiceLine(4);
|
SpeakVoiceLine(4);
|
||||||
state = 4;
|
state = 4;
|
||||||
|
questMarker.MoveTo(modelGenerationButton.transform);
|
||||||
modelGenerationButton.Deactivate();
|
modelGenerationButton.Deactivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,6 +132,7 @@ public class ShapeDetectionNPC : NPCController
|
|||||||
{
|
{
|
||||||
SpeakVoiceLine(5);
|
SpeakVoiceLine(5);
|
||||||
state = 5;
|
state = 5;
|
||||||
|
questMarker.MoveTo(shapeScanner.transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ public class QuestMarker : MonoBehaviour
|
|||||||
public Transform movingPart;
|
public Transform movingPart;
|
||||||
public float amplitude = 0.1f; // How far up/down it moves
|
public float amplitude = 0.1f; // How far up/down it moves
|
||||||
public float frequency = 1.5f; // Speed of oscillation
|
public float frequency = 1.5f; // Speed of oscillation
|
||||||
|
public float heightAboveTarget = 1f;
|
||||||
|
|
||||||
private Vector3 startPos;
|
private Vector3 startPos;
|
||||||
private Transform playerTransform;
|
private Transform playerTransform;
|
||||||
@@ -47,4 +48,9 @@ public class QuestMarker : MonoBehaviour
|
|||||||
playerTransform = null;
|
playerTransform = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void MoveTo(Transform target)
|
||||||
|
{
|
||||||
|
transform.position = target.position + new Vector3(0, heightAboveTarget, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user