forked from cgvr/DeltaVR
add particle effects to 3d printer
This commit is contained in:
@@ -11,6 +11,7 @@ public class Printer3D : MonoBehaviour
|
||||
|
||||
private bool isPrinting = false;
|
||||
private EventInstance printingSound;
|
||||
private ParticleSystem.EmissionModule particleEmission;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@@ -19,6 +20,9 @@ public class Printer3D : MonoBehaviour
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
|
||||
printingSound.setParameterByName("Occlusion", 0);
|
||||
printingSound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(spawnPoint));
|
||||
|
||||
particleEmission = GetComponentInChildren<ParticleSystem>().emission;
|
||||
particleEmission.enabled = false;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -32,6 +36,7 @@ public class Printer3D : MonoBehaviour
|
||||
isPrinting = true;
|
||||
printingSound.start();
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 0);
|
||||
particleEmission.enabled = true;
|
||||
|
||||
string encodedTexture = Convert.ToBase64String(texture.EncodeToJPG());
|
||||
byte[] encodedModel = await TrellisClient.Instance.GenerateModel(encodedTexture);
|
||||
@@ -40,6 +45,7 @@ public class Printer3D : MonoBehaviour
|
||||
InitializeSpawnedObject(spawnedObject);
|
||||
|
||||
printingSound.setParameterByName("3DPrinterPrintingJob", 1);
|
||||
particleEmission.enabled = false;
|
||||
isPrinting = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user