forked from cgvr/DeltaVR
new table model in archery range, disable buttons at first, play printing sound
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FMOD.Studio;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -7,16 +8,21 @@ public class ModelDisplay : MonoBehaviour
|
||||
public Transform displayPoint;
|
||||
public Transform glassTransform;
|
||||
public Material modelDisplayActiveMaterial;
|
||||
public Transform wire;
|
||||
public MeshRenderer[] wires;
|
||||
public Material wireActiveMaterial;
|
||||
|
||||
public GameObject Model { get; private set; }
|
||||
public float generatedObjectRotationSpeed = 10f;
|
||||
|
||||
private EventInstance printingSound;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
printingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Printing);
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
|
||||
printingSound.setParameterByName("Occlusion", 0);
|
||||
printingSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(displayPoint));
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -28,9 +34,15 @@ public class ModelDisplay : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void StartPrinting()
|
||||
{
|
||||
printingSound.start();
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 0);
|
||||
}
|
||||
|
||||
public void DisplayModel(GameObject modelObject)
|
||||
{
|
||||
foreach (MeshRenderer meshRenderer in wire.GetComponentsInChildren<MeshRenderer>())
|
||||
foreach (MeshRenderer meshRenderer in wires)
|
||||
{
|
||||
meshRenderer.material = wireActiveMaterial;
|
||||
}
|
||||
@@ -43,5 +55,7 @@ public class ModelDisplay : MonoBehaviour
|
||||
modelObject.transform.parent = displayPoint;
|
||||
modelObject.transform.position = displayPoint.position;
|
||||
Model = modelObject;
|
||||
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user