继续完善 装备buff
This commit is contained in:
@@ -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) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
|
||||
Reference in New Issue
Block a user