lib/pixi/src/core/utils/pluginTarget.js
function pluginTarget(obj)
{
    obj.__plugins = {};

    /**
     * Adds a plugin to an object
     *
     * @param pluginName {string} The events that should be listed.
     * @param ctor {Object} ?? @alvin
     */
    obj.registerPlugin = function (pluginName, ctor)
    {
        obj.__plugins[pluginName] = ctor;
    };

    /**
     * Instantiates all the plugins of this object
     *
     */
    obj.prototype.initPlugins = function ()
    {
        this.plugins = this.plugins || {};

        for (var o in obj.__plugins)
        {
            this.plugins[o] = new (obj.__plugins[o])(this);
        }
    };

    /**
     * Removes all the plugins of this object
     *
     */
    obj.prototype.destroyPlugins = function ()
    {
        for (var o in this.plugins)
        {
            this.plugins[o].destroy();
            this.plugins[o] = null;
        }

        this.plugins = null;
    };
}
function pluginTarget(obj)
{
    obj.__plugins = {};

    /**
     * Adds a plugin to an object
     *
     * @param pluginName {string} The events that should be listed.
     * @param ctor {Object} ?? @alvin
     */
    obj.registerPlugin = function (pluginName, ctor)
    {
        obj.__plugins[pluginName] = ctor;
    };

    /**
     * Instantiates all the plugins of this object
     *
     */
    obj.prototype.initPlugins = function ()
    {
        this.plugins = this.plugins || {};

        for (var o in obj.__plugins)
        {
            this.plugins[o] = new (obj.__plugins[o])(this);
        }
    };

    /**
     * Removes all the plugins of this object
     *
     */
    obj.prototype.destroyPlugins = function ()
    {
        for (var o in this.plugins)
        {
            this.plugins[o].destroy();
            this.plugins[o] = null;
        }

        this.plugins = null;
    };
}
function pluginTarget ( obj ) { obj . __plugins = { } ; /**
     * Adds a plugin to an object
     *
     * @param pluginName {string} The events that should be listed.
     * @param ctor {Object} ?? @alvin
     */ obj . registerPlugin = function ( pluginName , ctor ) { obj . __plugins [ pluginName ] = ctor ; } ; /**
     * Instantiates all the plugins of this object
     *
     */ obj . prototype . initPlugins = function ( ) { this . plugins = this . plugins || { } ; for ( var o in obj . __plugins ) { this . plugins [ o ] = new ( obj . __plugins [ o ] ) ( this ) ; } } ; /**
     * Removes all the plugins of this object
     *
     */ obj . prototype . destroyPlugins = function ( ) { for ( var o in this . plugins ) { this . plugins [ o ] . destroy ( ) ; this . plugins [ o ] = null ; } this . plugins = null ; } ; }
Mixins functionality to make an object have "plugins".

@mixin
@memberof PIXI.utils
@param obj {object} The object to mix into.
@example
function MyObject() {}

pluginTarget.mixin(MyObject);
Mixins functionality to make an object have plugins .