Beispiel #1
0
        protected void FadeIn()
        {
            if (hasFaded)
            {
                return;
            }

            hasFaded = true;
            fadeTweener.Ramp(0f, 1f, Settings.FadeIn, setVolumeFadeModifier, ease: Settings.FadeInEase, getDeltaTime: getDeltaTime);
        }
Beispiel #2
0
        protected void SetPitchScale(float pitch, float time, TweenUtility.Ease ease, bool fromSelf)
        {
            if (state == AudioStates.Stopped)
            {
                return;
            }

            if (fromSelf)
            {
                rampPitchTweener.Stop();

                if (time > 0f)
                {
                    rampPitchTweener.Ramp(pitchModifier.RampModifier, pitch, time, setPitchRampModifier, ease, getDeltaTime);
                }
                else
                {
                    pitchModifier.RampModifier = pitch;
                }
            }
            else
            {
                rampParentPitchTweener.Stop();

                if (time > 0f)
                {
                    rampParentPitchTweener.Ramp(pitchModifier.ParentModifier, pitch, time, setPitchParentModifier, ease, getDeltaTime);
                }
                else
                {
                    pitchModifier.ParentModifier = pitch;
                }
            }
        }
Beispiel #3
0
        protected void SetVolumeScale(float volume, float time, TweenUtility.Ease ease, bool fromSelf)
        {
            if (state == AudioStates.Stopped)
            {
                return;
            }

            if (fromSelf)
            {
                rampVolumeTweener.Stop();

                if (time > 0f)
                {
                    rampVolumeTweener.Ramp(volumeModifier.RampModifier, volume, time, setVolumeRampModifier, ease, getDeltaTime);
                }
                else
                {
                    volumeModifier.RampModifier = volume;
                }
            }
            else
            {
                rampParentVolumeTweener.Stop();

                if (time > 0f)
                {
                    rampParentVolumeTweener.Ramp(volumeModifier.ParentModifier, volume, time, setVolumeParentModifier, ease, getDeltaTime);
                }
                else
                {
                    volumeModifier.ParentModifier = volume;
                }
            }
        }