You can now pass a data argument to ScenePlugin.switch

This commit is contained in:
Richard Davey 2024-08-25 22:34:15 +01:00
parent 4003aa7f3e
commit 53c491fb84
No known key found for this signature in database

View file

@ -632,14 +632,15 @@ var ScenePlugin = new Class({
* @genericUse {(T|string)} - [key]
*
* @param {(string|Phaser.Scene)} key - The Scene to start.
* @param {any} [data] - Optional data object to pass to either the Scene `wake` or `start` method.
*
* @return {this} This Scene Plugin instance.
*/
switch: function (key)
switch: function (key, data)
{
if (key !== this.key)
{
this.manager.queueOp('switch', this.key, key);
this.manager.queueOp('switch', this.key, key, data);
}
return this;