/// <summary> /// Creates a VolumeFade action for fading in a certain soundObject. /// </summary> /// <param name="soundObject">The soundObject to fade in.</param> /// <param name="time">The fading time.</param> /// <param name="endVolume">The destination volume.</param> public static VolumeFade FadeIn(ISoundObject soundObject, float time, float endVolume) { VolumeFade fade = new VolumeFade(soundObject, 0, endVolume, time, false); soundObject.Volume = 0.0f; soundObject.Play(); return(fade); }
/// <summary> /// Creates a VolumeFade action for fading out a certain soundObject. /// </summary> /// <param name="soundObject">The soundObject to fade out.</param> /// <param name="time">The fading time.</param> public static VolumeFade FadeOut(ISoundObject soundObject, float time) { VolumeFade fade = new VolumeFade(soundObject, soundObject.Volume, 0, time, true); return(fade); }