技能layer改变,位置信息修改
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('BezCom')
|
||||
export class BezCom extends Component {
|
||||
start() {
|
||||
let base =this.node.getComponent(SkillCom)
|
||||
if(this.node.parent.scale.x < 0){
|
||||
base.t_pos.x=base.t_pos.x*-1
|
||||
}
|
||||
let s_pos = v3(this.node.position.x,this.node.position.y)
|
||||
let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+100)
|
||||
let e_pos = v3(this.node.position.x+base.t_pos.x,this.node.position.y+base.t_pos.y)
|
||||
// if(this.node.parent.scale.x < 0){
|
||||
// base.t_pos.x=base.t_pos.x*-1
|
||||
// }
|
||||
let s_pos = v3(this.node.position.x,this.node.position.y+35)
|
||||
let c_pos = v3((base.t_pos.x+this.node.position.x)/2,this.node.position.y+200)
|
||||
let e_pos = v3(base.t_pos.x,this.node.position.y+50)
|
||||
let time =Math.abs(base.t_pos.x/base.speed)
|
||||
BezCom.bezierTo(this.node,time,s_pos,c_pos,e_pos,{
|
||||
BezCom.bezierTo(this.node,base.in_time,s_pos,c_pos,e_pos,{
|
||||
onComplete: (target?: object) => {
|
||||
base.is_destroy=true
|
||||
},
|
||||
},
|
||||
}).start();
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
if(smc.mission.pause) return
|
||||
}
|
||||
|
||||
public static bezierTo(target: any, duration: number, c1: Vec3, c2: Vec3, to: Vec3, opts: any) {
|
||||
|
||||
Reference in New Issue
Block a user