继续完善 装备buff

This commit is contained in:
2025-06-12 16:24:23 +08:00
parent 4c0d1023a0
commit cb38aa55a4
12 changed files with 227 additions and 190 deletions

View File

@@ -65,6 +65,7 @@ export class SkillCom extends CCComp {
// bm.speed=700
if(this.group==BoxSet.MONSTER) bm.controlPointSide=-1
bm.moveTo(this.targetPos)
}
// let dir_x = this.targetPos.x > this.node.position.x ? 1 : -1
@@ -240,16 +241,25 @@ export class SkillCom extends CCComp {
update(deltaTime: number) {
if(smc.mission.pause) return;
this.toDestroy();
if(this.animType==AnimType.linear) this.startLinearMove(deltaTime);
if (!this.node || !this.node.isValid) return;
if(this.animType == AnimType.linear) this.startLinearMove(deltaTime);
this.toDestroy();
}
toDestroy() {
if(this.is_destroy){
this.ent.destroy()
if (this.ent) {
this.ent.destroy();
} else {
// 如果ent不存在直接销毁节点
if (this.node && this.node.isValid) {
this.node.destroy();
}
}
}
}
doDestroy(){
console.log("doDestroy")
this.is_destroy=true
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */