mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
Now use the prestep event to update instead
This commit is contained in:
parent
11cbf0cf8d
commit
d595da49fd
2 changed files with 20 additions and 18 deletions
|
@ -227,6 +227,7 @@ var InputManager = new Class({
|
|||
this.touch.boot();
|
||||
this.gamepad.boot();
|
||||
|
||||
this.game.events.on('prestep', this.update, this);
|
||||
this.game.events.once('destroy', this.destroy, this);
|
||||
},
|
||||
|
||||
|
|
|
@ -116,24 +116,6 @@ var BaseSoundManager = new Class({
|
|||
*/
|
||||
this.pauseOnBlur = true;
|
||||
|
||||
game.events.on('blur', function ()
|
||||
{
|
||||
if (this.pauseOnBlur)
|
||||
{
|
||||
this.onBlur();
|
||||
}
|
||||
}, this);
|
||||
|
||||
game.events.on('focus', function ()
|
||||
{
|
||||
if (this.pauseOnBlur)
|
||||
{
|
||||
this.onFocus();
|
||||
}
|
||||
}, this);
|
||||
|
||||
game.events.once('destroy', this.destroy, this);
|
||||
|
||||
/**
|
||||
* Property that actually holds the value of global playback rate.
|
||||
*
|
||||
|
@ -179,6 +161,25 @@ var BaseSoundManager = new Class({
|
|||
* @since 3.0.0
|
||||
*/
|
||||
this.unlocked = false;
|
||||
|
||||
game.events.on('blur', function ()
|
||||
{
|
||||
if (this.pauseOnBlur)
|
||||
{
|
||||
this.onBlur();
|
||||
}
|
||||
}, this);
|
||||
|
||||
game.events.on('focus', function ()
|
||||
{
|
||||
if (this.pauseOnBlur)
|
||||
{
|
||||
this.onFocus();
|
||||
}
|
||||
}, this);
|
||||
|
||||
game.events.on('prestep', this.update, this);
|
||||
game.events.once('destroy', this.destroy, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue