コード例 #1
0
 public float GetVolume(AudioEnum audioEnum)
 {
     auxContainer = GetLogicalComponent <ListAudioContainer>().GetContainer(audioEnum);
     audioMixer.GetFloat(auxContainer.Name, out volumeMixer);
     volumeMixer = MathfExtend.Percent(volumeMixer, rangeAudioDb);
     return(volumeMixer);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
            }
        }