This commit is contained in:
2024-08-26 17:33:14 +08:00
parent 7b618eb645
commit 8a44a15153
18 changed files with 1413 additions and 808 deletions

View File

@@ -23,13 +23,14 @@ export class SkillCom extends CCComp {
scale:number = 1;
atk:number = 10;
angle:number = 0;
t_pos:Vec3 = null;
t_pos:Vec3 = null; // 目标增量
is_destroy:boolean = false;
box_group:number = 0;
box_tag:number=0;
type:number = 1;
time:Timer = new Timer(0.01);
start() {
// console.log("skill start position :",this.node.position)
this.node.active=true
this.node.angle = this.angle;
let collider = this.getComponent(Collider2D);
@@ -43,7 +44,7 @@ export class SkillCom extends CCComp {
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
}
if(this.t_pos){
//通过欧拉角 延长 目标点位置
//通过欧拉角 延长 目标点 增量
this.t_pos.x=Math.cos(this.angle * Math.PI / 180) * this.dis;
this.t_pos.y=Math.sin(this.angle * Math.PI / 180) * this.dis;
tween(this.node).to( 1,{ angle:this.angle,position: this.t_pos},