File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License }
55 */
66
7+ var ArrayRemove = require ( '../utils/array/Remove' ) ;
78var Class = require ( '../utils/Class' ) ;
89var NumberTweenBuilder = require ( './builders/NumberTweenBuilder' ) ;
910var PluginCache = require ( '../plugins/PluginCache' ) ;
@@ -374,6 +375,28 @@ var TweenManager = new Class({
374375 }
375376 } ,
376377
378+ /**
379+ * Removes the given tween from the Tween Manager, regardless of its state (pending or active).
380+ *
381+ * @method Phaser.Tweens.TweenManager#remove
382+ * @since 3.17.0
383+ *
384+ * @param {Phaser.Tweens.Tween } tween - The Tween to be removed.
385+ *
386+ * @return {Phaser.Tweens.TweenManager } This Tween Manager object.
387+ */
388+ remove : function ( tween )
389+ {
390+ ArrayRemove ( this . _add , tween ) ;
391+ ArrayRemove ( this . _pending , tween ) ;
392+ ArrayRemove ( this . _active , tween ) ;
393+ ArrayRemove ( this . _destroy , tween ) ;
394+
395+ tween . state = TWEEN_CONST . REMOVED ;
396+
397+ return this ;
398+ } ,
399+
377400 /**
378401 * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't.
379402 *
You can’t perform that action at this time.
0 commit comments