mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
No longer injects update
into a Scene, and now calls step
from init onwards.
This commit is contained in:
parent
f0348834c6
commit
eb8d3ccdf1
1 changed files with 7 additions and 12 deletions
|
@ -540,7 +540,7 @@ var SceneManager = new Class({
|
|||
{
|
||||
var sys = this.scenes[i].sys;
|
||||
|
||||
if (sys.settings.status === CONST.RUNNING)
|
||||
if (sys.settings.status > CONST.START && sys.settings.status <= CONST.RUNNING)
|
||||
{
|
||||
sys.step(time, delta);
|
||||
}
|
||||
|
@ -617,6 +617,12 @@ var SceneManager = new Class({
|
|||
}
|
||||
}
|
||||
|
||||
// If the Scene has an update function we'll set it now, otherwise it'll remain as NOOP
|
||||
if (scene.update)
|
||||
{
|
||||
sys.sceneUpdate = scene.update;
|
||||
}
|
||||
|
||||
settings.status = CONST.RUNNING;
|
||||
},
|
||||
|
||||
|
@ -660,11 +666,6 @@ var SceneManager = new Class({
|
|||
|
||||
newScene.sys.init(this.game);
|
||||
|
||||
if (!newScene.update)
|
||||
{
|
||||
newScene.update = NOOP;
|
||||
}
|
||||
|
||||
return newScene;
|
||||
}
|
||||
},
|
||||
|
@ -736,12 +737,6 @@ var SceneManager = new Class({
|
|||
{
|
||||
var sceneCallback = GetValue(sceneConfig, defaults[i], null);
|
||||
|
||||
// Must always have an update function, no matter what (the rest are optional)
|
||||
if (defaults[i] === 'update' && !sceneCallback)
|
||||
{
|
||||
sceneCallback = NOOP;
|
||||
}
|
||||
|
||||
if (sceneCallback)
|
||||
{
|
||||
newScene[defaults[i]] = sceneCallback;
|
||||
|
|
Loading…
Reference in a new issue