1
0
forked from cgvr/DeltaVR

add sound effects to button, mic stand, model generation, shape scanner

This commit is contained in:
2026-01-25 15:10:42 +02:00
parent 75bd66fc36
commit ec45c402af
8 changed files with 32 additions and 4 deletions

View File

@@ -1,11 +1,11 @@
### TODO ### TODO
* glTF loading: vahetada ära shader Universal render pipelin Lit, mitte panna buildi kaasa glTf oma * glTF loading: vahetada ära shader Universal render pipelin Lit, mitte panna buildi kaasa glTf oma
* shape scanner initialisation correct number of confs
* user flow: grab item? mida krabada * user flow: grab item? mida krabada
* user prefs: settinguid meelde jätta * user prefs: settinguid meelde jätta
* võtta spawnitud mudeli mõõtmed: mehscollideri max x, max y, etc? bounding box? * võtta spawnitud mudeli mõõtmed: mehscollideri max x, max y, etc? bounding box?
* mängija collide'ib spawnitud mudeliga - ei tohiks * mängija collide'ib spawnitud mudeliga - ei tohiks
* shape scanner: * shape scanner:
* initialisation correct number of confs
* mitte-liigutatavaks, aga samal ajal kõrgus dünaamiliselt õige. või lihtsalt piisavalt madalale asetada või väljaulatuv kang millest krabada * mitte-liigutatavaks, aga samal ajal kõrgus dünaamiliselt õige. või lihtsalt piisavalt madalale asetada või väljaulatuv kang millest krabada
* peenikesemad kiired * peenikesemad kiired
* mitte lihtsalt ontriggerenter ja -exit, sest kui mitu objekti lähevad samal ajal sisse * mitte lihtsalt ontriggerenter ja -exit, sest kui mitu objekti lähevad samal ajal sisse

View File

@@ -22,7 +22,9 @@ public class FMODEvents : MonoBehaviour
[field: SerializeField] public EventReference BowGrab { get; private set; } [field: SerializeField] public EventReference BowGrab { get; private set; }
[field: SerializeField] public EventReference Spray { get; private set; } [field: SerializeField] public EventReference Spray { get; private set; }
[field: SerializeField] public EventReference Coughing { get; private set; } [field: SerializeField] public EventReference Coughing { get; private set; }
//[field: SerializeField] public EventReference MyNewSoundEffect { get; private set; } [field: SerializeField] public EventReference KitchenPlate { get; private set; }
[field: SerializeField] public EventReference ShapeScannerSuccess { get; private set; }
[field: SerializeField] public EventReference Printing { get; private set; }
[field: Header("CAR")] [field: Header("CAR")]
[field: SerializeField] public EventReference DoorOpen { get; private set; } [field: SerializeField] public EventReference DoorOpen { get; private set; }
@@ -35,6 +37,7 @@ public class FMODEvents : MonoBehaviour
[field: SerializeField] public EventReference Hover { get; private set; } [field: SerializeField] public EventReference Hover { get; private set; }
[field: SerializeField] public EventReference LetterEnter { get; private set; } [field: SerializeField] public EventReference LetterEnter { get; private set; }
[field: SerializeField] public EventReference LetterHover { get; private set; } [field: SerializeField] public EventReference LetterHover { get; private set; }
[field: SerializeField] public EventReference RadioButton { get; private set; }
[field: Header("Initial events")] [field: Header("Initial events")]
[field: SerializeField] public EventReference PortalSpacial { get; private set; } [field: SerializeField] public EventReference PortalSpacial { get; private set; }

View File

@@ -1,6 +1,7 @@
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using FMOD.Studio;
public class ArcheryRangeModelGenerationController : MonoBehaviour public class ArcheryRangeModelGenerationController : MonoBehaviour
{ {
@@ -20,6 +21,7 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
public Material wireActiveMaterial; public Material wireActiveMaterial;
private bool modelGenerationInProgress; private bool modelGenerationInProgress;
private EventInstance printingSound;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
@@ -27,6 +29,9 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
imageGenerationButton.OnButtonPressed += InvokeImageGeneration; imageGenerationButton.OnButtonPressed += InvokeImageGeneration;
modelGenerationButton.OnButtonPressed += InvokeModelGeneration; modelGenerationButton.OnButtonPressed += InvokeModelGeneration;
modelGenerationInProgress = false; modelGenerationInProgress = false;
printingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Printing);
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
} }
// Update is called once per frame // Update is called once per frame
@@ -56,6 +61,10 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
private async void InvokeModelGeneration() private async void InvokeModelGeneration()
{ {
modelGenerationInProgress = true; modelGenerationInProgress = true;
printingSound.start();
printingSound.setParameterByName("3DPrinterPrintingJob", 0);
string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG()); string encodedTexture = Convert.ToBase64String(GeneratedTexture.EncodeToJPG());
byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture); byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture);
@@ -66,6 +75,8 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
spawnedObject.transform.position = modelDisplay.position; spawnedObject.transform.position = modelDisplay.position;
GeneratedModel = spawnedObject; GeneratedModel = spawnedObject;
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
OnModelReady(); OnModelReady();
modelGenerationButton.Deactivate(); modelGenerationButton.Deactivate();
modelGenerationInProgress = false; modelGenerationInProgress = false;
@@ -79,5 +90,6 @@ public class ArcheryRangeModelGenerationController : MonoBehaviour
} }
modelDisplay.GetComponent<MeshRenderer>().material = modelDisplayActiveMaterial; modelDisplay.GetComponent<MeshRenderer>().material = modelDisplayActiveMaterial;
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject);
} }
} }

View File

@@ -34,6 +34,7 @@ public class MicrophoneStand : MonoBehaviour
{ {
microphoneOffStatus.SetActive(false); microphoneOffStatus.SetActive(false);
microphoneOnStatus.SetActive(true); microphoneOnStatus.SetActive(true);
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.RadioButton, gameObject);
fmodWhisperBridge.ActivateRecording(); fmodWhisperBridge.ActivateRecording();
} }
} }
@@ -45,6 +46,7 @@ public class MicrophoneStand : MonoBehaviour
{ {
microphoneOffStatus.SetActive(true); microphoneOffStatus.SetActive(true);
microphoneOnStatus.SetActive(false); microphoneOnStatus.SetActive(false);
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.RadioButton, gameObject);
fmodWhisperBridge.DeactivateRecording(); fmodWhisperBridge.DeactivateRecording();
} }
} }

View File

@@ -57,6 +57,7 @@ public class PushableButton : MonoBehaviour
{ {
movableParts.DOLocalMoveY(downPositionY, moveDuration); movableParts.DOLocalMoveY(downPositionY, moveDuration);
isButtonDown = true; isButtonDown = true;
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
if (wire != null) if (wire != null)
{ {
@@ -71,6 +72,7 @@ public class PushableButton : MonoBehaviour
{ {
movableParts.DOLocalMoveY(upPositionY, moveDuration); movableParts.DOLocalMoveY(upPositionY, moveDuration);
isButtonDown = false; isButtonDown = false;
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject);
if (wire != null) if (wire != null)
{ {

View File

@@ -97,6 +97,8 @@ public class ShapeScanner : MonoBehaviour
rayCount = configuration.rows.SelectMany(row => row.cells).Count(); rayCount = configuration.rows.SelectMany(row => row.cells).Count();
correctRayStates = configuration.rows.SelectMany(row => row.cells).Count(cell => !cell); correctRayStates = configuration.rows.SelectMany(row => row.cells).Count(cell => !cell);
UpdateDisplay(calculateCorrectPercentage()); UpdateDisplay(calculateCorrectPercentage());
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject);
} }
private float calculateCorrectPercentage() private float calculateCorrectPercentage()

View File

@@ -13,6 +13,8 @@ public class NPCController : MonoBehaviour
public float mouthScalingMultiplier = 2.5f; public float mouthScalingMultiplier = 2.5f;
public float mouthMovementDuration = 0.25f; public float mouthMovementDuration = 0.25f;
public string voicelineKey;
// Start is called before the first frame update // Start is called before the first frame update
void Awake() void Awake()
{ {
@@ -22,6 +24,11 @@ public class NPCController : MonoBehaviour
isTalking = false; isTalking = false;
} }
void Start()
{
}
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {