From a73dc7a0ffae1bc95f99c4fb5f6f3eda5fb78d5d Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Thu, 21 Sep 2017 15:28:13 +0800 Subject: [PATCH] stop AnimationAnimator if all animations are removed --- cocos2d/animation/animation-animator.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos2d/animation/animation-animator.js b/cocos2d/animation/animation-animator.js index 4ba4094000..d61dda4afc 100644 --- a/cocos2d/animation/animation-animator.js +++ b/cocos2d/animation/animation-animator.js @@ -79,6 +79,10 @@ p.removeAnimation = function (anim) { if (index >= 0) { this._anims.fastRemoveAt(index); cc.director.getAnimationManager().removeAnimation(anim); + + if (this._anims.array.length === 0) { + this.stop(); + } } else { cc.errorID(3908);