Handling unlocking in update method

This commit is contained in:
Pavle Goloskokovic 2018-01-17 18:11:27 +01:00
parent fbb1388f2d
commit 28b098348b

View file

@ -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);