mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
Merge pull request #902 from 2youyou2/animation
should reinit AnimationStates if clips not contains AnimationState's clip
This commit is contained in:
@@ -346,7 +346,7 @@ var Animation = cc.Class({
|
||||
this._init();
|
||||
var state = this._nameToState[name];
|
||||
|
||||
if (CC_EDITOR && !state) {
|
||||
if (CC_EDITOR && (!state || !cc.js.array.contains(this._clips, state.clip))) {
|
||||
this._didInit = false;
|
||||
|
||||
if (this.animator) {
|
||||
@@ -488,6 +488,8 @@ var Animation = cc.Class({
|
||||
},
|
||||
|
||||
_createStates: function() {
|
||||
this._nameToState = {};
|
||||
|
||||
// create animation states
|
||||
var state = null;
|
||||
var defaultClipState = false;
|
||||
|
||||
Reference in New Issue
Block a user