forked from cgvr/DeltaVR
add models and use them in archery range minigame
This commit is contained in:
@@ -9,11 +9,13 @@ public class ArcheryRangeNPC : NPCController
|
||||
[Header("Archery Range Config")]
|
||||
public QuestMarker questMarker;
|
||||
public MicrophoneStand microphoneStand;
|
||||
public Transform microphoneStandQuestMarkerPoint;
|
||||
public PushableButton imageGenerationButton;
|
||||
public PushableButton modelGenerationButton;
|
||||
public Image imageDisplay;
|
||||
public ModelDisplay modelDisplay;
|
||||
public Transform startTarget;
|
||||
public float modelDisplaySize = 0.75f;
|
||||
public Transform startTargetQuestMarkerPoint;
|
||||
|
||||
private Texture2D GeneratedTexture;
|
||||
private EventInstance printingSound;
|
||||
@@ -53,7 +55,7 @@ public class ArcheryRangeNPC : NPCController
|
||||
await Task.Delay(6500);
|
||||
SpeakVoiceLine(2);
|
||||
questMarker.gameObject.SetActive(true);
|
||||
questMarker.MoveTo(microphoneStand.transform);
|
||||
questMarker.MoveTo(microphoneStandQuestMarkerPoint.transform);
|
||||
await Task.Delay(3000);
|
||||
|
||||
state = 1;
|
||||
@@ -110,13 +112,13 @@ public class ArcheryRangeNPC : NPCController
|
||||
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
|
||||
byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture);
|
||||
|
||||
GameObject spawnedObject = await ModelGenerationUtils.Instance.SpawnModel(encodedModel);
|
||||
GameObject spawnedObject = await ModelGenerationUtils.Instance.SpawnModel(encodedModel, modelDisplaySize);
|
||||
modelDisplay.DisplayModel(spawnedObject);
|
||||
|
||||
if (state == 4)
|
||||
{
|
||||
SpeakVoiceLine(5);
|
||||
questMarker.MoveTo(startTarget);
|
||||
questMarker.MoveTo(startTargetQuestMarkerPoint);
|
||||
state = 5;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user