private void DoSetVolume(AudioEnum audioEnum, float newVolume, bool isPercent) { if (isPercent) { newVolume = MathfExtend.ChangeRange(newVolume, rangeAudioDb); } auxContainer = GetLogicalComponent <ListAudioContainer>().ObeyGetContainer(audioEnum); audioMixer.SetFloat(auxContainer.Name, newVolume); }
public float DoGetVolume(AudioEnum audioEnum, bool isPercent) { auxContainer = GetLogicalComponent <ListAudioContainer>().ObeyGetContainer(audioEnum); audioMixer.GetFloat(auxContainer.Name, out volumeMixer); if (isPercent) { volumeMixer = MathfExtend.Percent(volumeMixer, rangeAudioDb); } return(volumeMixer); }
public void DoSetVolume(AudioEnum audioEnum, float value, bool isPercent, float time, AnimationCurve curve = null) { if (isPercent) { value = MathfExtend.ChangeRange(value, rangeAudioDb); } auxContainer = GetLogicalComponent <ListAudioContainer>().ObeyGetContainer(audioEnum); audioMixer.GetFloat(auxContainer.Name, out volumeMixer); if (value != volumeMixer) { volumeMixer = auxContainer.ObeyReset(volumeMixer, value, time, curve); activeContainers.Add(auxContainer); isActivedContainer = true; } }