VAURendererController.cs 873 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 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;
		}
	}
}