diff --git a/assets/script/game/hero/HeroMove.ts b/assets/script/game/hero/HeroMove.ts index 8a66bd6e..713d2792 100644 --- a/assets/script/game/hero/HeroMove.ts +++ b/assets/script/game/hero/HeroMove.ts @@ -35,6 +35,8 @@ export class HeroMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpd update(e: ecs.Entity) { // 1. 全局状态检查 if (!smc.mission.play || smc.mission.pause) return; + // 如果开启了暂停怪物行动(通常用于四选一界面),玩家角色也应该停止移动 + if (smc.mission.stop_mon_action) return; const model = e.get(HeroAttrsComp); const move = e.get(HeroMoveComp); diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 0d82d40c..44775349 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -177,6 +177,11 @@ export class MissionCardComp extends CCComp { this.noStop.active = true; this.checkNoStop() } + + // 如果没有开启 noStop,则暂停怪物行动 + if (!smc.data.noStop) { + smc.mission.stop_mon_action = true; + } this.resetCardStates(); this.refCards(); @@ -184,6 +189,11 @@ export class MissionCardComp extends CCComp { } checkNoStop(){ this.noStop.getChildByName("no").active=!smc.data.noStop + + // 更新暂停状态 + if (this.node.active) { + smc.mission.stop_mon_action = !smc.data.noStop; + } } switchNoStop(){ smc.data.noStop=!smc.data.noStop @@ -408,6 +418,9 @@ export class MissionCardComp extends CCComp { close() { this.node.active = false; + // 恢复游戏运行状态(取消暂停) + smc.mission.stop_mon_action = false; + // 关闭时隐藏按钮,避免下次打开其他类型时闪烁 if (this.btnClose) { this.btnClose.active = false;