mirror of
https://github.com/photonstorm/phaser
synced 2025-03-01 13:57:26 +00:00
Updated BaseSoundManager playAudioSprite method to return value from sound play method call
This commit is contained in:
parent
7a259da22c
commit
db5002fa87
1 changed files with 2 additions and 1 deletions
|
@ -194,11 +194,12 @@ var BaseSoundManager = new Class({
|
|||
* @param {string} key - Asset key for the sound.
|
||||
* @param {string} spriteName - The name of the sound sprite to play.
|
||||
* @param {ISoundConfig} [config] - An optional config object containing default sound settings.
|
||||
* @returns {boolean} Whether the audio sprite sound started playing successfully.
|
||||
*/
|
||||
playAudioSprite: function (key, spriteName, config) {
|
||||
var sound = this.addAudioSprite(key);
|
||||
sound.once('ended', sound.destroy, sound);
|
||||
sound.play(spriteName, config);
|
||||
return sound.play(spriteName, config);
|
||||
},
|
||||
/**
|
||||
* Removes a sound from the sound manager.
|
||||
|
|
Loading…
Add table
Reference in a new issue