英雄动画修复,技能反向修复

This commit is contained in:
2024-11-16 16:27:46 +08:00
parent 6ef4ccb773
commit 0793334379
29 changed files with 2899 additions and 2936 deletions

View File

@@ -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
// }