todo 技能存在时间准确性问题

This commit is contained in:
panw
2025-01-10 11:07:53 +08:00
parent b4158a0a29
commit 1d9af24c66
20 changed files with 315 additions and 457 deletions

View File

@@ -8,22 +8,20 @@ const { ccclass, property } = _decorator;
export class BuffCom extends Component {
cd:number = 0;
base:SkillCom = null
time:number = 0;
start() {
this.base =this.node.getComponent(SkillCom)
tween(this.node).to( this.base.in_time,
{ position: new Vec3(this.node.position.x,this.node.position.y) },
{
onComplete: (target?: object) => {
this.base.is_destroy=true
},
}
).start();
}
update(deltaTime: number) {
if(smc.mission.pause) return
this.cd+=deltaTime
this.time+=deltaTime
if(this.time>=this.base.in_time){
this.base.is_destroy = true
}
if(this.cd>=this.base.cd){
if(this.base.is_destroy) return
// this.node.setPosition(v3(-1000,0,0))
this.node.active = false
this.node.active = true