private float GetShownVolume() { if (audioMixerSaver == null) { return(0); } if (audioMixerSaver.GetMuted(channelType)) { return(AudioMixerSaver.MIN_VOLUME); } else { return(audioMixerSaver.GetVolume(channelType)); } }
private void DrawChannel(string label, AudioMixerSaver.ChannelType channelType) { EditorGUILayout.Space(); EditorGUILayout.LabelField(label); EditorGUI.BeginChangeCheck(); var muted = EditorGUILayout.Toggle("Muted", audioMixerSaves.GetMuted(channelType)); var volume = EditorGUILayout.FloatField("Db Boost", audioMixerSaves.GetVolume(channelType)); if (EditorGUI.EndChangeCheck()) { audioMixerSaves.SetMuted(channelType, muted); audioMixerSaves.SetVolume(channelType, volume); } }
private void Awake() { toggle.onValueChanged.AddListener(Mute); toggle.isOn = checkedMeansMuted ? mixerSaver.GetMuted(channelType) : !mixerSaver.GetMuted(channelType); }