Skip to content

Commit 5022830

Browse files
committed
Added preDestroy handler
1 parent bf65d6b commit 5022830

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/gameobjects/rope/Rope.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,26 @@ var Rope = new Class({
901901
return this;
902902
},
903903

904+
/**
905+
* Handles the pre-destroy step for the Rope, which removes the Animation component and typed arrays.
906+
*
907+
* @method Phaser.GameObjects.Rope#preDestroy
908+
* @private
909+
* @since 3.23.0
910+
*/
911+
preDestroy: function ()
912+
{
913+
this.anims.destroy();
914+
915+
this.anims = undefined;
916+
917+
this.points = null;
918+
this.vertices = null;
919+
this.uv = null;
920+
this.colors = null;
921+
this.alphas = null;
922+
},
923+
904924
/**
905925
* The horizontally flipped state of the Game Object.
906926
*

0 commit comments

Comments
 (0)