File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,10 +130,36 @@ Phaser.PluginManager.prototype = {
130130 * @param {Phaser.Plugin } plugin - The plugin to be removed.
131131 */
132132 remove : function ( plugin ) {
133+
134+ if ( this . _pluginsLength == 0 )
135+ {
136+ return ;
137+ }
133138
134- // TODO
135- this . _pluginsLength -- ;
139+ for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ )
140+ {
141+ if ( this . plugins [ this . _p ] === plugin )
142+ {
143+ plugin . destroy ( ) ;
144+ this . plugins . splice ( this . _p , 1 ) ;
145+ this . _pluginsLength -- ;
146+ return ;
147+ }
148+ }
149+ } ,
136150
151+ /**
152+ * Removes all Plugins from the PluginManager.
153+ * @method Phaser.PluginManager#removeAll
154+ */
155+ removeAll : function ( ) {
156+
157+ for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ )
158+ {
159+ this . plugins [ this . _p ] . destroy ( ) ;
160+ }
161+ this . plugins . length = 0 ;
162+ this . _pluginsLength = 0 ;
137163 } ,
138164
139165 /**
You can’t perform that action at this time.
0 commit comments