mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 22:48:34 +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;
|
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);
|
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;
|
settings.status = CONST.RUNNING;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -660,11 +666,6 @@ var SceneManager = new Class({
|
||||||
|
|
||||||
newScene.sys.init(this.game);
|
newScene.sys.init(this.game);
|
||||||
|
|
||||||
if (!newScene.update)
|
|
||||||
{
|
|
||||||
newScene.update = NOOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
return newScene;
|
return newScene;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -736,12 +737,6 @@ var SceneManager = new Class({
|
||||||
{
|
{
|
||||||
var sceneCallback = GetValue(sceneConfig, defaults[i], null);
|
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)
|
if (sceneCallback)
|
||||||
{
|
{
|
||||||
newScene[defaults[i]] = sceneCallback;
|
newScene[defaults[i]] = sceneCallback;
|
||||||
|
|
Loading…
Add table
Reference in a new issue