fix(英雄移动): 添加暂停怪物行动时英雄也停止移动的逻辑
当开启四选一界面时暂停怪物行动,现在英雄移动也会同步暂停。同时在MissionCardComp中添加对stop_mon_action状态的管理,确保界面开关时游戏状态正确切换。
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user