mirror of
https://github.com/wassname/phaser.git
synced 2026-07-03 17:10:40 +08:00
Merge pull request #139 from beeglebug/master
Added init method to plugins, to be called as they are added to the PluginManager
This commit is contained in:
@@ -103,6 +103,13 @@ Phaser.PluginManager.prototype = {
|
||||
}
|
||||
|
||||
this._pluginsLength = this.plugins.push(plugin);
|
||||
|
||||
// Allows plugins to run potentially destructive code outside of the constructor, and only if being added to the PluginManager
|
||||
if (typeof plugin['init'] === 'function')
|
||||
{
|
||||
plugin.init();
|
||||
}
|
||||
|
||||
return plugin;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user