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; } } }
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; } } }