mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Can only sleep a running scene
This commit is contained in:
parent
fa8a25f6a8
commit
31cbacbe20
1 changed files with 16 additions and 14 deletions
|
@ -435,18 +435,13 @@ var Systems = new Class({
|
|||
{
|
||||
console.warn('Cannot pause non-running Scene', settings.key);
|
||||
}
|
||||
else
|
||||
{
|
||||
var events = this.events;
|
||||
|
||||
if (this.settings.active)
|
||||
else if (this.settings.active)
|
||||
{
|
||||
settings.status = CONST.PAUSED;
|
||||
|
||||
settings.active = false;
|
||||
|
||||
events.emit(Events.PAUSE, this, data);
|
||||
}
|
||||
this.events.emit(Events.PAUSE, this, data);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
@ -498,15 +493,22 @@ var Systems = new Class({
|
|||
*/
|
||||
sleep: function (data)
|
||||
{
|
||||
var events = this.events;
|
||||
var settings = this.settings;
|
||||
var status = this.getStatus();
|
||||
|
||||
if (status !== CONST.CREATING || status !== CONST.RUNNING)
|
||||
{
|
||||
console.warn('Cannot sleep non-running Scene', settings.key);
|
||||
}
|
||||
else
|
||||
{
|
||||
settings.status = CONST.SLEEPING;
|
||||
|
||||
settings.active = false;
|
||||
settings.visible = false;
|
||||
|
||||
events.emit(Events.SLEEP, this, data);
|
||||
this.events.emit(Events.SLEEP, this, data);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue