mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Add isPaused() methods to ScenePlugin, SceneManager
This commit is contained in:
parent
0b2658c1b0
commit
0d1e0f203d
2 changed files with 39 additions and 0 deletions
|
@ -911,6 +911,28 @@ var SceneManager = new Class({
|
|||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines whether a Scene is paused.
|
||||
*
|
||||
* @method Phaser.Scenes.SceneManager#isPaused
|
||||
* @since 3.17.0
|
||||
*
|
||||
* @param {string} key - The Scene to check.
|
||||
*
|
||||
* @return {boolean} Whether the Scene is paused.
|
||||
*/
|
||||
isPaused: function (key)
|
||||
{
|
||||
var scene = this.getScene(key);
|
||||
|
||||
if (scene)
|
||||
{
|
||||
return scene.sys.isPaused();
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines whether a Scene is visible.
|
||||
*
|
||||
|
|
|
@ -693,6 +693,23 @@ var ScenePlugin = new Class({
|
|||
return this.manager.isActive(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the given Scene is paused or not?
|
||||
*
|
||||
* @method Phaser.Scenes.ScenePlugin#isPaused
|
||||
* @since 3.17.0
|
||||
*
|
||||
* @param {string} [key] - The Scene to check.
|
||||
*
|
||||
* @return {boolean} Whether the Scene is paused.
|
||||
*/
|
||||
isPaused: function (key)
|
||||
{
|
||||
if (key === undefined) { key = this.key; }
|
||||
|
||||
return this.manager.isPaused(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the given Scene is visible or not?
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue