diff --git a/VAURendererController.cs b/VAURendererController.cs new file mode 100644 index 0000000000000000000000000000000000000000..6b2ffac070913a666138622f49a4cf2602a8298e --- /dev/null +++ b/VAURendererController.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class VAURendererController : MonoBehaviour +{ + public string RendererID = ""; + public bool OutputMuted = false; + public double OutputGain = 1.0; + + private bool OutputMutedShadow; + private double OutputGainShadow; + + void Start () + { + VAUAdapter.VA.SetRenderingModuleMuted( RendererID, OutputMuted ); + VAUAdapter.VA.SetRenderingModuleGain( RendererID, OutputGain ); + + OutputMutedShadow = OutputMuted; + OutputGainShadow = OutputGain; + } + + void Update() + { + if( OutputMuted != OutputMutedShadow ) + { + VAUAdapter.VA.SetRenderingModuleMuted( RendererID, OutputMuted ); + OutputMutedShadow = OutputMuted; + } + if( OutputGain != OutputGainShadow ) + { + VAUAdapter.VA.SetRenderingModuleGain( RendererID, OutputGain ); + OutputGainShadow = OutputGain; + } + } +} diff --git a/VAUReproductionController.cs b/VAUReproductionController.cs new file mode 100644 index 0000000000000000000000000000000000000000..951216cb3156b0df3c9123e8a57c81497e754d68 --- /dev/null +++ b/VAUReproductionController.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class VAUReproductionController : MonoBehaviour +{ + public string ReproductionID = ""; + public bool OutputMuted = false; + public double OutputGain = 1.0; + + private bool OutputMutedShadow; + private double OutputGainShadow; + + void Start () + { + VAUAdapter.VA.SetReproductionModuleMuted( ReproductionID, OutputMuted ); + VAUAdapter.VA.SetReproductionModuleGain( ReproductionID, OutputGain ); + + OutputMutedShadow = OutputMuted; + OutputGainShadow = OutputGain; + } + + void Update() + { + if( OutputMuted != OutputMutedShadow ) + { + VAUAdapter.VA.SetReproductionModuleMuted( ReproductionID, OutputMuted ); + OutputMutedShadow = OutputMuted; + } + if( OutputGain != OutputGainShadow ) + { + VAUAdapter.VA.SetReproductionModuleGain( ReproductionID, OutputGain ); + OutputGainShadow = OutputGain; + } + } +}