diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index cd5db488..6eaa3846 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -92,6 +92,9 @@ export class HeroViewComp extends CCComp { /** 初始化/重置视图状态 */ init() { + this.status = "idle"; + this.deadCD = 0; + this.lastBarUpdateTime = 0; this.as.idle() // 初始化 UI 节点 diff --git a/assets/script/game/hero/Mon.ts b/assets/script/game/hero/Mon.ts index 5c2b912d..b03906c2 100644 --- a/assets/script/game/hero/Mon.ts +++ b/assets/script/game/hero/Mon.ts @@ -139,6 +139,7 @@ export class Monster extends ecs.Entity { // 初始化移动参数,包括线路和生成顺序 const move = this.get(MonMoveComp); + move.reset(); move.direction = -1; // 向左移动 move.targetX = -800; // 左边界 move.lane = lane; // 设置线路标识