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

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

@@ -57,7 +57,7 @@ export class Skill extends ecs.Entity {
// console.log(smc.skills[uuid].name+"angle:"+angle)
sv.s_uuid = uuid;
sv.atk = atk;
node.setScale(v3(node.scale.x*scale,node.scale.y))
// node.setScale(v3(node.scale.x*scale,node.scale.y))
sv.speed=smc.skills[uuid].speed;
sv.dis=smc.skills[uuid].dis+dis;

View File

@@ -38,8 +38,10 @@ export class SkillCom extends CCComp {
run_type:number = 0; // 0有目标 带方向1贝塞尔曲线 2 不动 ,3 直线
in_time:number = 0.3; // 不动技能持续时间
start() {
// console.log("skill start run_type",this.run_type)
console.log("skill start run_type",this.run_type)
if(this.node.parent.scale.x < 0){
this.t_pos.x=this.t_pos.x*-1
}
this.x_speed=Math.cos(this.angle * Math.PI / 180) * this.speed-30*this.scale;
this.y_speed=Math.sin(this.angle * Math.PI / 180) * this.speed;
this.node.active=true
@@ -70,6 +72,7 @@ export class SkillCom extends CCComp {
let distance = Math.sqrt(squaredDistance);
time = distance / this.speed;
let e_pos=v3(this.node.position.x+this.t_pos.x,this.node.position.y+this.t_pos.y)
console.log("skill tx:"+e_pos.x+" node :"+this.node.position.x)
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
// console.log("skill ",this.node.getRotation())
tween(this.node).to( time,{ position: e_pos},

View File

@@ -8,6 +8,7 @@ export class dead extends Component {
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
onAnimationFinished(){
console.log("动画结束");
this.node.destroy();
}
update(deltaTime: number) {