Skip to content

Commit 5f56d03

Browse files
Implemented remove method
1 parent 5790fe9 commit 5f56d03

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

v3/src/sound/BaseSoundManager.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,14 @@ var BaseSoundManager = new Class({
134134
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));
135135
sound.play(spriteName, config);
136136
},
137-
remove: NOOP,
137+
remove: function (sound) {
138+
var index = this.sounds.indexOf(sound);
139+
if (index !== -1) {
140+
this.sounds.splice(index, 1);
141+
return true;
142+
}
143+
return false;
144+
},
138145
removeByKey: NOOP,
139146
pauseAll: function () {
140147
this.sounds.forEach(function (sound) {

0 commit comments

Comments
 (0)