Updated BaseSoundManager playAudioSprite method to return value from sound play method call

This commit is contained in:
Pavle Goloskokovic 2018-01-20 19:53:09 +01:00
parent 7a259da22c
commit db5002fa87

View file

@ -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.