dd
This commit is contained in:
@@ -57,13 +57,15 @@ export class SkillCom extends CCComp {
|
||||
|
||||
|
||||
if(this.run_type == 0){ //直线,默认直线,有特定目标 朝向目标直线
|
||||
|
||||
let time = 720 / this.speed;
|
||||
let squaredDistance = this.t_pos.x * this.t_pos.x + this.t_pos.y * this.t_pos.y;
|
||||
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)
|
||||
|
||||
tween(this.node).to( time,{ angle:this.angle,position: e_pos},
|
||||
this.node.getChildByName("skill").setRotationFromEuler(0,0,this.angle)
|
||||
console.log("skill ",this.node.getRotation())
|
||||
tween(this.node).to( time,{ position: e_pos},
|
||||
{
|
||||
easing: "linear",
|
||||
onUpdate: (target: Vec3, ratio: number) => { },
|
||||
|
||||
Reference in New Issue
Block a user