VAUController.cs 1.25 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VAUController : MonoBehaviour
{
	public bool InputMuted = false;
	public double InputGain = 1.0;
	public bool OutputMuted = false;
	public double OutputGain = 1.0;
	
	private bool InputMutedShadow;
	private double InputGainShadow;
	private bool OutputMutedShadow;
	private double OutputGainShadow;

    void Start ()
    {
		VAUAdapter.VA.SetInputMuted( InputMuted );
		VAUAdapter.VA.SetInputGain( InputGain );
		VAUAdapter.VA.SetOutputMuted( OutputMuted );
		VAUAdapter.VA.SetOutputGain( OutputGain );
		
		InputMutedShadow = InputMuted;
		InputGainShadow = InputGain;
		OutputMutedShadow = OutputMuted;
27
        OutputGainShadow = OutputGain;
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    }
	
	void Update()
	{
		if( InputMuted != InputMutedShadow )
		{
			VAUAdapter.VA.SetInputMuted( InputMuted );	
			InputMutedShadow = InputMuted;
		}
		if( InputGain != InputGainShadow )
		{
			VAUAdapter.VA.SetInputGain( InputGain );	
			InputGainShadow = InputGain;
		}
		if( OutputMuted != OutputMutedShadow )
		{
			VAUAdapter.VA.SetOutputMuted( OutputMuted );	
			OutputMutedShadow = OutputMuted;
		}
		if( OutputGain != OutputGainShadow )
		{
			VAUAdapter.VA.SetOutputGain( OutputGain );	
			OutputGainShadow = OutputGain;
		}
	}
}