需要修复 英雄目标错误

This commit is contained in:
pan@work
2024-09-18 17:45:23 +08:00
parent 2ab7279b04
commit 01ad8b619e
17 changed files with 834 additions and 1723 deletions

View File

@@ -18,7 +18,7 @@ const { ccclass, property } = _decorator;
export class RoleSpine extends Component {
private loop: boolean = true;
private spine!: sp.Skeleton;
private default:string = "move";
private default:string = "idle";
private atk_name: string = "atk";
private move_name: string = "move";
private max_name: string = "max";
@@ -32,17 +32,16 @@ export class RoleSpine extends Component {
this.spine = this.node.getChildByName("anm")!.getComponent(sp.Skeleton);
this.spine.setEndListener(trackEntry => {
var animationName = trackEntry.animation ? trackEntry.animation.name : "";
console.log("[track %s][animation %s] end.", trackEntry.trackIndex, animationName);
// if (animationName == "atk" || animationName== "max" ) {
// this.spine.setAnimation(0, this.default, true);
// }
// console.log("[track %s][animation %s] end.", trackEntry.trackIndex, animationName);
if (animationName == "atk" || animationName== "max" ) {
this.spine.setAnimation(0, this.default, true);
}
});
}
protected play(animName: string, loop: boolean) {
}
atk(){
this.spine.setAnimation(0, this.atk_name, false);
}
idle(){