v3.6.1 Documentation
Fungus.MusicManager Class Reference

Music manager which provides basic music and sound effect functionality. More...

Inheritance diagram for Fungus.MusicManager:

Public Member Functions

void PlayMusic (AudioClip musicClip, bool loop, float fadeDuration, float atTime)
 Plays game music using an audio clip. More...
 
virtual void PlaySound (AudioClip soundClip, float volume)
 Plays a sound effect once, at the specified volume. More...
 
virtual void SetAudioPitch (float pitch, float duration, System.Action onComplete)
 Shifts the game music pitch to required value over a period of time. More...
 
virtual void SetAudioVolume (float volume, float duration, System.Action onComplete)
 Fades the game music volume to required level over a period of time. More...
 
virtual void StopMusic ()
 Stops playing game music. More...
 

Protected Member Functions

virtual void Start ()
 

Detailed Description

Music manager which provides basic music and sound effect functionality.

Music playback persists across scene loads.

Definition at line 13 of file MusicManager.cs.

Member Function Documentation

◆ PlayMusic()

void Fungus.MusicManager.PlayMusic ( AudioClip  musicClip,
bool  loop,
float  fadeDuration,
float  atTime 
)

Plays game music using an audio clip.

One music clip may be played at a time.

Definition at line 27 of file MusicManager.cs.

◆ PlaySound()

virtual void Fungus.MusicManager.PlaySound ( AudioClip  soundClip,
float  volume 
)
virtual

Plays a sound effect once, at the specified volume.

Parameters
soundClipThe sound effect clip to play.
volumeThe volume level of the sound effect.

Definition at line 66 of file MusicManager.cs.

◆ SetAudioPitch()

virtual void Fungus.MusicManager.SetAudioPitch ( float  pitch,
float  duration,
System.Action  onComplete 
)
virtual

Shifts the game music pitch to required value over a period of time.

Parameters
pitchThe new music pitch value.
durationThe length of time in seconds needed to complete the pitch change.
onCompleteA delegate method to call when the pitch shift has completed.

Definition at line 77 of file MusicManager.cs.

◆ SetAudioVolume()

virtual void Fungus.MusicManager.SetAudioVolume ( float  volume,
float  duration,
System.Action  onComplete 
)
virtual

Fades the game music volume to required level over a period of time.

Parameters
volumeThe new music volume value [0..1]
durationThe length of time in seconds needed to complete the volume change.
onCompleteDelegate function to call when fade completes.

Definition at line 110 of file MusicManager.cs.

◆ Start()

virtual void Fungus.MusicManager.Start ( )
protectedvirtual

Definition at line 15 of file MusicManager.cs.

◆ StopMusic()

virtual void Fungus.MusicManager.StopMusic ( )
virtual

Stops playing game music.

Definition at line 140 of file MusicManager.cs.


The documentation for this class was generated from the following file: