mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Added game.add.plugin, a shotcut for game.plugins.add
This commit is contained in:
parent
6ce183189f
commit
f6f70d35a4
1 changed files with 17 additions and 0 deletions
|
@ -411,8 +411,25 @@ Phaser.GameObjectFactory.prototype = {
|
|||
|
||||
return filter;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Add a new Plugin into the PluginManager.
|
||||
* The Plugin must have 2 properties: game and parent. Plugin.game is set to ths game reference the PluginManager uses, and parent is set to the PluginManager.
|
||||
*
|
||||
* @method Phaser.GameObjectFactory#plugin
|
||||
* @param {object|Phaser.Plugin} plugin - The Plugin to add into the PluginManager. This can be a function or an existing object.
|
||||
* @param {...*} parameter - Additional parameters that will be passed to the Plugin.init method.
|
||||
* @return {Phaser.Plugin} The Plugin that was added to the manager.
|
||||
*/
|
||||
plugin: function (plugin) {
|
||||
|
||||
return this.game.plugins.add(plugin);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
Phaser.GameObjectFactory.prototype.constructor = Phaser.GameObjectFactory;
|
||||
|
|
Loading…
Add table
Reference in a new issue