![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Responsible for storing and playing the game's music and sound effects using the FMOD package. To trigger a sound effect from a script, use "AudioManager.instance.PlaySFX()" or any of the other functions here.
Documentation updated 2/2/2025
Make pausing/unpausing the game pause/unpause all game sounds.
Stop all sounds when exiting to main menu and play main menu theme.
Public Member Functions | |
void | PlaySFX (EventReference sound) |
Basic function to play a given sound once. | |
void | PlayOneShot (EventReference sound, Vector2 worldPos) |
Plays a short sound once from a given location. | |
void | PlayMusic (EventReference musicRef) |
Plays a sound (expected to be music) continously, stopping any track currently playing unless it's the same as the parameter. | |
void | StopMusic () |
Stops the currently playing music. | |
void | VolumeChanged () |
Updates the volume each audio bus plays at. | |
Static Public Attributes | |
static AudioManager | instance |
To make the object persistent, it needs a reference to itself. | |
Private Member Functions | |
void | Awake () |
Make this object persistent and set reference to data manager. If this is the only AudioManager in the scene, don’t destroy it on reload. If there’s another AudioManager in the scene, destroy it. | |
Private Attributes | |
DataManager | dataManager |
Reference to the data manager. | |
EventReference | currentMusicReference |
Reference to the music that is currently playing. | |
EventInstance | currentMusicInstance |
|
private |
Make this object persistent and set reference to data manager. If this is the only AudioManager in the scene, don’t destroy it on reload. If there’s another AudioManager in the scene, destroy it.
void AudioManager.PlayMusic | ( | EventReference | musicRef | ) |
Plays a sound (expected to be music) continously, stopping any track currently playing unless it's the same as the parameter.
void AudioManager.PlayOneShot | ( | EventReference | sound, |
Vector2 | worldPos ) |
Plays a short sound once from a given location.
void AudioManager.PlaySFX | ( | EventReference | sound | ) |
Basic function to play a given sound once.
void AudioManager.StopMusic | ( | ) |
Stops the currently playing music.
void AudioManager.VolumeChanged | ( | ) |
Updates the volume each audio bus plays at.
|
private |
|
private |
Reference to the music that is currently playing.
|
private |
Reference to the data manager.
|
static |
To make the object persistent, it needs a reference to itself.