コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
        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;
            }
        }