英雄动画修复,技能反向修复
This commit is contained in:
@@ -73,7 +73,7 @@ export class HeroSpine extends Component {
|
||||
}
|
||||
idle(){
|
||||
if(!this.in_playing()){
|
||||
// console.log("do idle");
|
||||
console.log("do idle");
|
||||
this.animator.play(this.idle_clip.name);
|
||||
}
|
||||
}
|
||||
@@ -85,12 +85,12 @@ export class HeroSpine extends Component {
|
||||
|
||||
max(){
|
||||
// console.log("do max");
|
||||
this.animator.play(this.max_clip.name);
|
||||
this.animator.play(this.max_clip.name);
|
||||
}
|
||||
|
||||
move(){
|
||||
if(!this.in_playing()){
|
||||
// console.log("do move");
|
||||
if(!this.animator.getState(this.move_clip.name).isPlaying) {
|
||||
console.log("doing move");
|
||||
this.animator.play(this.move_clip.name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export class HeroViewComp extends CCComp {
|
||||
} /** 视图层逻辑代码分离演示 */
|
||||
|
||||
start () {
|
||||
this.as.move()
|
||||
this.as.idle()
|
||||
/** 方向 */
|
||||
this.node.setScale(this.scale,1);
|
||||
this.node.getChildByName("top").setScale(this.scale,1);
|
||||
@@ -219,15 +219,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.move(dt);
|
||||
|
||||
}
|
||||
status_change(type:string){
|
||||
if(this.status == type) return
|
||||
this.status=type
|
||||
if(type != "move"){
|
||||
this.as.change_default("idle")
|
||||
}else{
|
||||
this.as.change_default("move")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
change_anm(){
|
||||
@@ -280,12 +272,20 @@ export class HeroViewComp extends CCComp {
|
||||
}else{
|
||||
this.is_atking=false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
status_change(type:string){
|
||||
this.status=type
|
||||
if(type == "idle"){
|
||||
this.as.idle()
|
||||
this.as.change_default("idle")
|
||||
}
|
||||
if(type == "move"){
|
||||
this.as.move()
|
||||
this.as.change_default("move")
|
||||
}
|
||||
}
|
||||
move(dt: number){
|
||||
if(this.stop_cd > 0){
|
||||
this.as.idle()
|
||||
this.status_change("idle")
|
||||
return
|
||||
}
|
||||
@@ -295,8 +295,9 @@ export class HeroViewComp extends CCComp {
|
||||
if(this.scale===-1&&this.node.position.x <= -360){
|
||||
return;
|
||||
}
|
||||
this.as.move()
|
||||
this.status_change("move")
|
||||
|
||||
|
||||
// if(this.enemy){
|
||||
// return
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user