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:
Richard Davey
2013-10-28 03:28:13 -07:00
+7
View File
@@ -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