// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). // It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) using UnityEngine; namespace Fungus { /// /// Music manager which provides basic music and sound effect functionality. /// Music playback persists across scene loads. /// public interface IMusicController { /// /// Plays game music using an audio clip. /// One music clip may be played at a time. /// void PlayMusic(AudioClip musicClip, bool loop, float fadeDuration, float atTime); /// /// Plays a sound effect once, at the specified volume. /// /// The sound effect clip to play. /// The volume level of the sound effect. void PlaySound(AudioClip soundClip, float volume); /// /// Shifts the game music pitch to required value over a period of time. /// /// The new music pitch value. /// The length of time in seconds needed to complete the pitch change. /// A delegate method to call when the pitch shift has completed. void SetAudioPitch(float pitch, float duration, System.Action onComplete); /// /// Fades the game music volume to required level over a period of time. /// /// The new music volume value [0..1] /// The length of time in seconds needed to complete the volume change. /// Delegate function to call when fade completes. void SetAudioVolume(float volume, float duration, System.Action onComplete); /// /// Stops playing game music. /// void StopMusic(); } }