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;
}
}
}

View File

@@ -1,5 +1,6 @@
using DG.Tweening;
using FMODUnity;
using UnityEngine;
public class PushableButton : MonoBehaviour
@@ -12,6 +13,7 @@ public class PushableButton : MonoBehaviour
public Transform movableParts;
public float moveDuration = 0.25f;
public float moveAmount = 0.05f;
public EventReference soundEffect = FMODEvents.Instance.Click;
public MeshRenderer[] wires;
public Material wireActiveMaterial;
@@ -58,7 +60,7 @@ public class PushableButton : MonoBehaviour
{
movableParts.DOLocalMoveY(downPositionY, moveDuration);
isButtonDown = true;
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
AudioManager.Instance.PlayAttachedInstance(soundEffect, gameObject);
if (wires != null)
{
@@ -73,7 +75,7 @@ public class PushableButton : MonoBehaviour
{
movableParts.DOLocalMoveY(upPositionY, moveDuration);
isButtonDown = false;
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
AudioManager.Instance.PlayAttachedInstance(soundEffect, gameObject);
if (wires != null)
{