From 00d0495eaa4ca55ee3d9e69934f357fbfa1a0171 Mon Sep 17 00:00:00 2001 From: Leslie Leigh Date: Mon, 24 Jun 2019 10:17:15 +0800 Subject: [PATCH] bug fix (#4674) * bug fix * Update animation-component.ts --- cocos/components/animation-component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/components/animation-component.ts b/cocos/components/animation-component.ts index 97e18d0d39..43a9fa8aaa 100644 --- a/cocos/components/animation-component.ts +++ b/cocos/components/animation-component.ts @@ -193,6 +193,11 @@ export class AnimationComponent extends Component implements IEventTarget { cc.director.getAnimationManager().removeCrossFade(this._crossFade); this._crossFade.stop(); } + for (const name of Object.keys(this._nameToState)) { + const state = this._nameToState[name]; + state.stop(); + } + this._nameToState = null as any; } /**