Merge pull request #638 from 2youyouo2/anim

update animation
This commit is contained in:
Jare Guo
2016-04-28 18:13:32 +08:00
+6 -8
View File
@@ -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);
}
}
});