public float GetVolume(AudioEnum audioEnum) { auxContainer = GetLogicalComponent <ListAudioContainer>().GetContainer(audioEnum); audioMixer.GetFloat(auxContainer.Name, out volumeMixer); volumeMixer = MathfExtend.Percent(volumeMixer, rangeAudioDb); return(volumeMixer); }
public void SetVolume(AudioEnum audioEnum, float value, bool isPercent) { Debug.Assert(value >= 0 && value <= 1); if (isPercent) { value = MathfExtend.ChangeRange(value, rangeAudioDb); } auxContainer = GetLogicalComponent <ListAudioContainer>().GetContainer(audioEnum); audioMixer.SetFloat(auxContainer.Name, value); }
public void SetVolume(AudioEnum audioEnum, float value, bool isPercent, float time, AnimationCurve curve = null) { Debug.Assert(value >= 0 && value <= 1 && time >= 0); if (isPercent) { value = MathfExtend.ChangeRange(value, rangeAudioDb); } auxContainer = GetLogicalComponent <ListAudioContainer>().GetContainer(audioEnum); audioMixer.GetFloat(auxContainer.Name, out volumeMixer); if (value != volumeMixer) { volumeMixer = auxContainer.ObeyReset(volumeMixer, value, time, curve); activeContainers.Add(auxContainer); isActivedContainer = true; } }