Sound effects - UQcsse3200/2024-studio-1 GitHub Wiki
Playing sound effects the normal way (using getAsset(...).play()
) will play the sound at the same volume every time, regardless of the sound volume set by the user, specified in UserSettings
.
To fix this, the ResourceService
has been extended to add a new method to play a sound at the user-specified volume:
playSound(String soundName)
No sound is played when the mute setting is on.
This method allows any team who wants to play a sound effect to do so without worrying about user settings, which is currently mostly the responsibility of the menus team.
Any sounds played must be loaded first.