From 28b098348b401683b1e85f0f847d2c552ea8fff7 Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Wed, 17 Jan 2018 18:11:27 +0100 Subject: [PATCH] Handling unlocking in update method --- src/sound/BaseSoundManager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sound/BaseSoundManager.js b/src/sound/BaseSoundManager.js index 9a09778d9..0027db8af 100644 --- a/src/sound/BaseSoundManager.js +++ b/src/sound/BaseSoundManager.js @@ -309,6 +309,10 @@ var BaseSoundManager = new Class({ * @param {number} delta - The delta time elapsed since the last frame. */ update: function (time, delta) { + if (this.unlocked) { + this.unlocked = false; + this.emit('unlocked', this); + } for (var i = this.sounds.length - 1; i >= 0; i--) { if (this.sounds[i].pendingRemove) { this.sounds.splice(i, 1);