Made sure array was cleared on destroy #5159

This commit is contained in:
Richard Davey 2020-07-13 12:23:19 +01:00
parent b8d12916e9
commit 60baaf7708

View file

@ -91,8 +91,8 @@ var Animation = new Class({
* A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes.
*
* @name Phaser.GameObjects.Components.Animation#nextAnimsQueue
* @type {Array}
* @default []
* @type {string[]}
* @since 3.24.0
*/
this.nextAnimsQueue = [];
@ -866,7 +866,7 @@ var Animation = new Class({
{
var key = this.nextAnim;
this.nextAnim = this.nextAnimsQueue.length > 0 ? this.nextAnimsQueue.shift() : null;
this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null;
this.play(key);
}
@ -1178,6 +1178,7 @@ var Animation = new Class({
this.animationManager = null;
this.parent = null;
this.nextAnimsQueue.length = 0;
this.currentAnim = null;
this.currentFrame = null;