修复 buff 逻辑处理 bug : 预制体不能设置全局监听oops.message.on,会一直执行

This commit is contained in:
walkpan
2024-08-28 00:09:55 +08:00
parent 5b1991c90f
commit 4096a17330
15 changed files with 195 additions and 143 deletions

View File

@@ -28,13 +28,11 @@ export class Monster extends ecs.Entity {
MonsterBuff!: MonsterBuffComp; // 移动
protected init() {
this.addComponents<ecs.Comp>(
MonsterModelComp);
this.addComponents<ecs.Comp>( MonsterModelComp);
}
destroy(): void {
this.remove(MonsterViewComp);
this.remove(MonsterBuffComp);
super.destroy();
@@ -84,10 +82,10 @@ export class Monster extends ecs.Entity {
}
hero_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
var mv = node.getComponent(MonsterViewComp)!;
var buff = node.getComponent(MonsterBuffComp)!;
var buff =node.getComponent(MonsterBuffComp)!;
mv.speed =mv.ospeed = smc.heros[uuid].speed;
mv.hero_name= smc.heros[uuid].name;
mv.box_group= BoxSet.MONSTER;
buff.group=mv.box_group= BoxSet.MONSTER;
mv.hp= mv.hp_max = smc.heros[uuid].hp;
mv.level = smc.heros[uuid].level;
mv.atk = smc.heros[uuid].atk;
@@ -99,7 +97,6 @@ export class Monster extends ecs.Entity {
mv.scale = -1;
mv.Tpos = v3(0,0,0);
this.add(mv);
this.add(buff)
this.add(buff);
}
}