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:
Richard Davey 2018-04-09 10:20:57 +01:00 committed by GitHub
commit a0dcfdd3fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}