From f6679b5a0749aae4b8ee9cbc833cca00da3ef39e Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Thu, 28 Apr 2016 16:01:56 +0800 Subject: [PATCH] update animation --- cocos2d/core/components/CCAnimation.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cocos2d/core/components/CCAnimation.js b/cocos2d/core/components/CCAnimation.js index c2b38bf0a8..c707ab6985 100644 --- a/cocos2d/core/components/CCAnimation.js +++ b/cocos2d/core/components/CCAnimation.js @@ -112,12 +112,8 @@ var Animation = cc.Class({ get: function () { return this._currentClip; }, - set: function (value, force) { + set: function (value) { this._currentClip = value; - - if (CC_EDITOR && force && value) { - this._updateClip(value); - } }, type: AnimationClip, visible: false @@ -503,7 +499,7 @@ var Animation = cc.Class({ } }, - _updateClip: (CC_TEST || CC_EDITOR) && function (clip, clipName) { + _updateClip: (CC_TEST || CC_EDITOR) && function (clip, clipName, notReload) { this._init(); clipName = clipName || clip.name; @@ -535,8 +531,10 @@ var Animation = cc.Class({ oldState._name = clipName; } - oldState._clip = clip; - this._animator._reloadClip(oldState); + if (!notReload) { + oldState._clip = clip; + this._animator._reloadClip(oldState); + } } });