photonstorm/phaser — pull request #139 by beeglebug (2013-10-28 08:42:47+00:00)
Title: Added init method to plugins, to be called as they are added to the PluginManager

This will allow potentially destructive code to run outside of the plugin constructor, and only if it has been successfully added to the PluginManager.

I've been playing around with plugins, and found a couple of examples when I needed to create an instance of my plugin, but without certain code running at that point. For example, I may want to create the plugin instance, then set a variable, or call a method, then add it to the game, and have some code occur at that point, prior to the first update/render, but still within the plugin.