File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,8 +261,7 @@ Phaser.SoundManager.prototype = {
261261 */
262262 setTouchLock : function ( ) {
263263
264- this . game . input . touch . callbackContext = this ;
265- this . game . input . touch . touchStartCallback = this . unlock ;
264+ this . game . input . touch . addTouchLockCallback ( this . unlock , this ) ;
266265 this . touchLocked = true ;
267266
268267 } ,
@@ -271,12 +270,13 @@ Phaser.SoundManager.prototype = {
271270 * Enables the audio, usually after the first touch.
272271 *
273272 * @method Phaser.SoundManager#unlock
273+ * @return {boolean } True if the callback should be removed, otherwise false.
274274 */
275275 unlock : function ( ) {
276276
277277 if ( this . noAudio || ! this . touchLocked || this . _unlockSource !== null )
278278 {
279- return ;
279+ return true ;
280280 }
281281
282282 // Global override (mostly for Audio Tag testing)
@@ -306,8 +306,7 @@ Phaser.SoundManager.prototype = {
306306 }
307307
308308 // We can remove the event because we've done what we needed (started the unlock sound playing)
309- this . game . input . touch . callbackContext = null ;
310- this . game . input . touch . touchStartCallback = null ;
309+ return true ;
311310
312311 } ,
313312
You can’t perform that action at this time.
0 commit comments