diff --git a/v3/src/sound/BaseSoundManager.js b/v3/src/sound/BaseSoundManager.js index aa37ef832..730c4348f 100644 --- a/v3/src/sound/BaseSoundManager.js +++ b/v3/src/sound/BaseSoundManager.js @@ -215,6 +215,19 @@ var BaseSoundManager = new Class({ sound.destroy(); }); this.sounds = null; + }, + /** + * @private + * @param {(value: ISound, index: number, array: ISound[]) => void} callbackfn + * @param thisArg + */ + forEachActiveSound: function (callbackfn, thisArg) { + var _this = this; + this.sounds.forEach(function (sound, index) { + if (!sound.pendingRemove) { + callbackfn.call(thisArg || _this, sound, index, _this.sounds); + } + }); } }); /**