mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Merge pull request #3470 from pixelhijack/fix-issue-3363
[ISSUE #3363] Phaser Scene - passing data to scene init & create methods
This commit is contained in:
commit
a0dcfdd3fc
1 changed files with 9 additions and 4 deletions
|
@ -180,7 +180,7 @@ var SceneManager = new Class({
|
|||
{
|
||||
entry = this._start[i];
|
||||
|
||||
this.start(entry);
|
||||
this.start(entry, entry.scene.data);
|
||||
}
|
||||
|
||||
this._start.length = 0;
|
||||
|
@ -219,7 +219,7 @@ var SceneManager = new Class({
|
|||
{
|
||||
entry = this._start[i];
|
||||
|
||||
this.start(entry);
|
||||
this.start(entry, entry.scene.data);
|
||||
}
|
||||
|
||||
// Clear the pending lists
|
||||
|
@ -309,7 +309,7 @@ var SceneManager = new Class({
|
|||
{
|
||||
if (this.game.isBooted)
|
||||
{
|
||||
this.start(key);
|
||||
this.start(key, newScene.sys.settings.data);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -697,6 +697,11 @@ var SceneManager = new Class({
|
|||
}
|
||||
}
|
||||
|
||||
if (sceneConfig.hasOwnProperty('data'))
|
||||
{
|
||||
newScene.data = sceneConfig.data;
|
||||
}
|
||||
|
||||
return newScene;
|
||||
},
|
||||
|
||||
|
@ -953,7 +958,7 @@ var SceneManager = new Class({
|
|||
if (entry.key === key)
|
||||
{
|
||||
entry.autoStart = true;
|
||||
entry.data = data;
|
||||
entry.scene.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue