This commit is contained in:
2024-09-25 17:23:56 +08:00
parent 3870bdec50
commit 5831697fb8
21 changed files with 155 additions and 93 deletions

View File

@@ -30,7 +30,7 @@ export class Skill extends ecs.Entity {
super.destroy();
}
load(pos: Vec3 = Vec3.ZERO,group:number,parent:Node,
uuid:number=1001,atk:number =10,t_pos:Vec3 = null)
uuid:number=1001,atk:number =10,t_pos:Vec3 = null,dis:number=0,)
{
var path = "game/skills/"+smc.skills[uuid].sp_name;
@@ -60,7 +60,7 @@ export class Skill extends ecs.Entity {
node.setScale(v3(node.scale.x*scale,node.scale.y))
sv.speed=smc.skills[uuid].speed;
sv.dis=smc.skills[uuid].dis;
sv.dis=smc.skills[uuid].dis+dis;
sv.run_type=smc.skills[uuid].run;
if(sv.dis == 0){
sv.run_type=2

View File

@@ -55,7 +55,14 @@ export class SkillCom extends CCComp {
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
if(this.run_type == 3){ //直线,默认直线,有特定目标 朝向目标直线
let tx=this.node.position.x+this.dis
// console.log("skill tx:"+tx+" node :"+this.node.position.x)
let e_pos=v3(tx,this.node.position.y)
tween(this.node).to( 0.2,{ position: e_pos},
{onComplete: (target?: object) => { this.is_destroy=true },}
).start();
}
if(this.run_type == 0){ //直线,默认直线,有特定目标 朝向目标直线
let time = 720 / this.speed;