暂时解决 受伤触发技能 出错问题

This commit is contained in:
2024-11-17 08:59:35 +08:00
parent 227cfd26d4
commit 75d2dd5988
6 changed files with 57 additions and 29 deletions

View File

@@ -38,7 +38,7 @@ 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
}
@@ -72,7 +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)
// 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},
@@ -149,7 +149,7 @@ export class SkillCom extends CCComp {
toDestroy() {
if(this.is_destroy){
if(this.node.parent) this.ent.destroy()
this.ent.destroy()
}
}