英雄动画修复,技能反向修复
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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) {
|
||||
Reference in New Issue
Block a user