DoopelPonger
|
Manages the different types of background tracks that are being played. More...
Public Member Functions | |
void | Awake () |
Initializes the class with the EventManager and sets the max volume. More... | |
void | FixedUpdate () |
Sets the timescale of each background track to match the game speed. More... | |
void | SetMaxVolume (float maxVolume) |
Master volume control for sound effects. More... | |
float | GetMaxVolume () |
Returns the master volume for sound effects. More... | |
Public Attributes | |
BackgroundMusic [] | backgroundMusicPrefabs |
float | slowmoTimeScaleMultiplier |
float | timeToFadeIn |
float | timeBeforeTrackChange |
Manages the different types of background tracks that are being played.
There are three versions of the background music, each playing the same song but having a slightly different set of instruments. This is done to make the music a little bit less repetative. The mixer handles these tracks by playing them all at the same time but only lets one play at the max volume, all other tracks are muted. When it is time to change tracks only the volumes are changed.
void BackgroundMusicMixer.Awake | ( | ) |
Initializes the class with the EventManager and sets the max volume.
void BackgroundMusicMixer.FixedUpdate | ( | ) |
Sets the timescale of each background track to match the game speed.
float BackgroundMusicMixer.GetMaxVolume | ( | ) |
Returns the master volume for sound effects.
void BackgroundMusicMixer.SetMaxVolume | ( | float | maxVolume | ) |
Master volume control for sound effects.
maxVolume | New volume for sound effects. Clamped between 0 and 1 |
BackgroundMusic [] BackgroundMusicMixer.backgroundMusicPrefabs |
All the tracks for the background music.
float BackgroundMusicMixer.slowmoTimeScaleMultiplier |
When the game goes in slow motion, the background music slows down as well, but if the music slows down at the same rate as the time step then it sounds really bad. The multiplier makes sure the tracks don't get too slow when going in slow motion.
float BackgroundMusicMixer.timeBeforeTrackChange |
The amount of time before the background track changes.
float BackgroundMusicMixer.timeToFadeIn |
The amount of time it takes to fade in the background music when the game starts.