Liberi
An exergame built for kids with CP!
MusicPlayer Class Reference

A Singleton Class that manages the music playing. Presists across scenes and provides various methods for Playing/Stopping/Fading to various music tracks. More...

Inherits MonoBehaviour.

Static Public Member Functions

static void Play (string trackName)
 
static void Play (AudioClip track)
 
static void PlayOneShot (string trackName)
 
static void PlayOneShot (AudioClip track)
 Abruptly play an audio track and don't loop it. More...
 
static void Stop ()
 Abruptly Stop playing the current audio track. More...
 
static void CrossFade (string trackName, float fadeTime=1.0f)
 Given a string name of a music track, load that track and crossfade from the current track to it. More...
 
static void CrossFade (AudioClip track, float fadeTime=1.0f)
 Given an audio clip, crossfade from the current track to it. More...
 
static void FadeOut (float fadeTime=1.0f)
 Fade Out the currently playing track. More...
 

Public Attributes

AnimationCurve FadeCurve
 

Properties

static AudioSource ActiveSource [get]
 
static AudioSource IdleSource [get]
 

Detailed Description

A Singleton Class that manages the music playing. Presists across scenes and provides various methods for Playing/Stopping/Fading to various music tracks.

Definition at line 9 of file MusicPlayer.cs.

Member Function Documentation

static void MusicPlayer.CrossFade ( string  trackName,
float  fadeTime = 1.0f 
)
inlinestatic

Given a string name of a music track, load that track and crossfade from the current track to it.

Definition at line 82 of file MusicPlayer.cs.

static void MusicPlayer.CrossFade ( AudioClip  track,
float  fadeTime = 1.0f 
)
inlinestatic

Given an audio clip, crossfade from the current track to it.

Definition at line 91 of file MusicPlayer.cs.

static void MusicPlayer.FadeOut ( float  fadeTime = 1.0f)
inlinestatic

Fade Out the currently playing track.

Definition at line 99 of file MusicPlayer.cs.

static void MusicPlayer.PlayOneShot ( AudioClip  track)
inlinestatic

Abruptly play an audio track and don't loop it.

Definition at line 65 of file MusicPlayer.cs.

static void MusicPlayer.Stop ( )
inlinestatic

Abruptly Stop playing the current audio track.

Definition at line 74 of file MusicPlayer.cs.


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