继续技能系统重构
This commit is contained in:
@@ -25,8 +25,6 @@ export class AtkConCom extends CCComp {
|
||||
targetPos: Vec3 = v3(); // 目标位置
|
||||
group:number = 0; //阵营
|
||||
fac:number=0; //阵营
|
||||
caster:any=null;
|
||||
|
||||
// 战斗相关运行时数据
|
||||
ap:number=0;
|
||||
burn_count:number=0;
|
||||
@@ -85,6 +83,34 @@ export class AtkConCom extends CCComp {
|
||||
}
|
||||
|
||||
}
|
||||
do_parabolic(){
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
this.node.angle +=10
|
||||
// bm.speed=700
|
||||
if(this.group==BoxSet.MONSTER) {bm.controlPointSide=-1 }
|
||||
bm.rotationSmoothness=0.6
|
||||
bm.moveTo(this.targetPos)
|
||||
}
|
||||
do_line(){
|
||||
let bm=this.node.getComponent(BezierMove)
|
||||
let s_x=this.startPos.x
|
||||
let s_y=this.startPos.y
|
||||
let t_x=this.targetPos.x
|
||||
let t_y=this.targetPos.y
|
||||
// 设定目标x
|
||||
this.targetPos.x = 400;
|
||||
if(this.group == BoxSet.MONSTER) {
|
||||
bm.controlPointSide = -1;
|
||||
this.targetPos.x = -400;
|
||||
}
|
||||
// 计算斜率
|
||||
const k = (t_y - s_y) / (t_x - s_x);
|
||||
// 按直线公式计算新的y
|
||||
this.targetPos.y = k * (this.targetPos.x - s_x) + s_y;
|
||||
bm.controlPointOffset=0
|
||||
bm.rotationSmoothness=0.6
|
||||
bm.moveTo(this.targetPos);
|
||||
}
|
||||
onAnimationFinished(){
|
||||
// console.log("[SkillCom]:onAnimationFinished",this.s_uuid)
|
||||
if (!this.skillConfig) return;
|
||||
|
||||
Reference in New Issue
Block a user