fix:调整默认状态调用点
This commit is contained in:
parent
06aef65b2a
commit
7a1b589424
@ -121,6 +121,8 @@ export default class AnimatorBase extends cc.Component {
|
|||||||
*/
|
*/
|
||||||
protected initJson(json: any) {
|
protected initJson(json: any) {
|
||||||
this._ac = new AnimatorController(this, json);
|
this._ac = new AnimatorController(this, json);
|
||||||
|
// 执行默认状态
|
||||||
|
this._ac.changeState(json.defaultState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,13 +41,11 @@ export default class AnimatorController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultState: string = json.defaultState;
|
|
||||||
this._anyState = new AnimatorState(json.anyState, this);
|
this._anyState = new AnimatorState(json.anyState, this);
|
||||||
for (let i = 0; i < json.states.length; i++) {
|
for (let i = 0; i < json.states.length; i++) {
|
||||||
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
||||||
this._states.set(state.name, state);
|
this._states.set(state.name, state);
|
||||||
}
|
}
|
||||||
this.changeState(defaultState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateState() {
|
private updateState() {
|
||||||
|
@ -122,6 +122,8 @@ export default class AnimatorBase extends Component {
|
|||||||
*/
|
*/
|
||||||
protected initJson(json: any) {
|
protected initJson(json: any) {
|
||||||
this._ac = new AnimatorController(this, json);
|
this._ac = new AnimatorController(this, json);
|
||||||
|
// 执行默认状态
|
||||||
|
this._ac.changeState(json.defaultState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,13 +42,11 @@ export default class AnimatorController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultState: string = json.defaultState;
|
|
||||||
this._anyState = new AnimatorState(json.anyState, this);
|
this._anyState = new AnimatorState(json.anyState, this);
|
||||||
for (let i = 0; i < json.states.length; i++) {
|
for (let i = 0; i < json.states.length; i++) {
|
||||||
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
||||||
this._states.set(state.name, state);
|
this._states.set(state.name, state);
|
||||||
}
|
}
|
||||||
this.changeState(defaultState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateState() {
|
private updateState() {
|
||||||
|
@ -121,6 +121,8 @@ export default class AnimatorBase extends cc.Component {
|
|||||||
*/
|
*/
|
||||||
protected initJson(json: any) {
|
protected initJson(json: any) {
|
||||||
this._ac = new AnimatorController(this, json);
|
this._ac = new AnimatorController(this, json);
|
||||||
|
// 执行默认状态
|
||||||
|
this._ac.changeState(json.defaultState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,13 +41,11 @@ export default class AnimatorController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultState: string = json.defaultState;
|
|
||||||
this._anyState = new AnimatorState(json.anyState, this);
|
this._anyState = new AnimatorState(json.anyState, this);
|
||||||
for (let i = 0; i < json.states.length; i++) {
|
for (let i = 0; i < json.states.length; i++) {
|
||||||
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
||||||
this._states.set(state.name, state);
|
this._states.set(state.name, state);
|
||||||
}
|
}
|
||||||
this.changeState(defaultState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateState() {
|
private updateState() {
|
||||||
|
@ -122,6 +122,8 @@ export default class AnimatorBase extends Component {
|
|||||||
*/
|
*/
|
||||||
protected initJson(json: any) {
|
protected initJson(json: any) {
|
||||||
this._ac = new AnimatorController(this, json);
|
this._ac = new AnimatorController(this, json);
|
||||||
|
// 执行默认状态
|
||||||
|
this._ac.changeState(json.defaultState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,13 +42,11 @@ export default class AnimatorController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let defaultState: string = json.defaultState;
|
|
||||||
this._anyState = new AnimatorState(json.anyState, this);
|
this._anyState = new AnimatorState(json.anyState, this);
|
||||||
for (let i = 0; i < json.states.length; i++) {
|
for (let i = 0; i < json.states.length; i++) {
|
||||||
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
let state: AnimatorState = new AnimatorState(json.states[i], this);
|
||||||
this._states.set(state.name, state);
|
this._states.set(state.name, state);
|
||||||
}
|
}
|
||||||
this.changeState(defaultState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateState() {
|
private updateState() {
|
||||||
|
Loading…
Reference in New Issue
Block a user