dd
This commit is contained in:
@@ -44,43 +44,53 @@ export class HeroSpine extends Component {
|
||||
|
||||
// console.log("mon spine init",this.animator);
|
||||
}
|
||||
|
||||
in_playing(){
|
||||
if(this.animator.getState(this.atk_clip.name).isPlaying) return true;
|
||||
if(this.animator.getState(this.max_clip.name).isPlaying) return true;
|
||||
if(this.animator.getState(this.idle_clip.name).isPlaying) return true;
|
||||
if(this.animator.getState(this.move_clip.name).isPlaying) return true;
|
||||
return false;
|
||||
}
|
||||
onAnimationEvent(type: Animation.EventType, state: AnimationState){
|
||||
if(type==Animation.EventType.FINISHED){
|
||||
console.log("animator end",state.name);
|
||||
if(state.name==this.atk_clip.name||state.name==this.max_clip.name){
|
||||
console.log("animator no atk and no max");
|
||||
this.default();
|
||||
}
|
||||
}
|
||||
}
|
||||
change_default(value:string){
|
||||
console.log("change default",value);
|
||||
this.default_clip=value;
|
||||
}
|
||||
default() {
|
||||
if(!this.animator.getState(this.default_clip).isPlaying){
|
||||
if(!this.in_playing()){
|
||||
console.log("do default");
|
||||
this.animator.play(this.default_clip);
|
||||
}
|
||||
|
||||
}
|
||||
idle(){
|
||||
if(!this.animator.getState(this.idle_clip.name).isPlaying){
|
||||
if(!this.in_playing()){
|
||||
console.log("do idle");
|
||||
this.animator.play(this.idle_clip.name);
|
||||
}
|
||||
}
|
||||
atk() {
|
||||
if(!this.animator.getState(this.atk_clip.name).isPlaying){
|
||||
this.animator.play(this.atk_clip.name);
|
||||
}
|
||||
console.log("do atk");
|
||||
this.animator.play(this.atk_clip.name);
|
||||
}
|
||||
|
||||
|
||||
max(){
|
||||
if(!this.animator.getState(this.max_clip.name).isPlaying){
|
||||
console.log("do max");
|
||||
this.animator.play(this.max_clip.name);
|
||||
}
|
||||
}
|
||||
|
||||
move(){
|
||||
if(!this.animator.getState(this.move_clip.name).isPlaying){
|
||||
if(!this.in_playing()){
|
||||
console.log("do move");
|
||||
this.animator.play(this.move_clip.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user