1
0
forked from cgvr/DeltaVR

replaced computer printer model, enter key correct sound effect

This commit is contained in:
2026-02-28 12:03:52 +02:00
parent d7c2634bda
commit 2d057ac2ba
8 changed files with 362 additions and 485 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
public class ShapeDetectionNPC : NPCController
{
@@ -12,7 +11,6 @@ public class ShapeDetectionNPC : NPCController
public ComputerPrinter computerPrinter;
public Printer3DInputHole printerInsertionHole;
public Texture2D GeneratedTexture { get; private set; }
public Image imageDisplay;
public ShapeScanner shapeScanner;
public float radioAmount = 1f;
@@ -24,7 +22,6 @@ public class ShapeDetectionNPC : NPCController
// 3 - player spoke into the radio
// 4 - player pressed enter on keyboard
// 5 - player inserted picture into printer
// 6 - finished speaking
private int state;
private float lastPlayerApproachTime;
@@ -117,7 +114,7 @@ public class ShapeDetectionNPC : NPCController
}
}
private async void OnPlayerInitiatedPrinting()
private void OnPlayerInitiatedPrinting()
{
if (state == 4)
{
@@ -125,16 +122,5 @@ public class ShapeDetectionNPC : NPCController
state = 5;
questMarker.MoveTo(shapeScanner.transform, true);
}
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture);
GameObject spawnedObject = await ModelGenerationUtils.Instance.SpawnModel(encodedModel);
if (state == 5)
{
state = 6;
}
}
}