Add isPaused() methods to ScenePlugin, SceneManager

This commit is contained in:
samme 2019-02-27 12:23:02 -08:00
parent 0b2658c1b0
commit 0d1e0f203d
2 changed files with 39 additions and 0 deletions

View file

@ -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.
*

View file

@ -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?
*