mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Merge pull request #6876 from wooseok123/wooseok123-feat-switch
feat : add data argument in Scene.switch
This commit is contained in:
commit
8ef75453d0
1 changed files with 3 additions and 2 deletions
|
@ -1322,10 +1322,11 @@ var SceneManager = new Class({
|
||||||
*
|
*
|
||||||
* @param {(string|Phaser.Scene)} from - The Scene to sleep.
|
* @param {(string|Phaser.Scene)} from - The Scene to sleep.
|
||||||
* @param {(string|Phaser.Scene)} to - The Scene to start.
|
* @param {(string|Phaser.Scene)} to - The Scene to start.
|
||||||
|
* @param {object} [data] - Optional data object to pass to `Scene.Settings` and `Scene.init`, and `Scene.create`. It is only passed when the scene starts for the first time.
|
||||||
*
|
*
|
||||||
* @return {this} This Scene Manager instance.
|
* @return {this} This Scene Manager instance.
|
||||||
*/
|
*/
|
||||||
switch: function (from, to)
|
switch: function (from, to, data)
|
||||||
{
|
{
|
||||||
var sceneA = this.getScene(from);
|
var sceneA = this.getScene(from);
|
||||||
var sceneB = this.getScene(to);
|
var sceneB = this.getScene(to);
|
||||||
|
@ -1340,7 +1341,7 @@ var SceneManager = new Class({
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.start(to);
|
this.start(to, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue