From e04b69e55df243e73352b0cbbfb6e6ed85d652c4 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Wed, 10 Aug 2016 14:06:16 +0800 Subject: [PATCH] refine code --- cocos2d/core/components/CCAnimation.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/components/CCAnimation.js b/cocos2d/core/components/CCAnimation.js index 643857ccd8..fbb01027ff 100644 --- a/cocos2d/core/components/CCAnimation.js +++ b/cocos2d/core/components/CCAnimation.js @@ -169,12 +169,13 @@ var Animation = cc.Class({ onEnable: function () { if (!CC_EDITOR && this.playOnLoad && this._defaultClip) { this.playOnLoad = false; - + var state = this.getAnimationState(this._defaultClip.name); this._animator.playState(state); } - - this.resume(); + else { + this.resume(); + } }, onDisable: function () {