refactor(游戏逻辑): 统一使用is_master判断玩家角色并简化暂停逻辑
将多处使用FacSet.HERO判断玩家角色的代码改为使用is_master属性 将stop_mon_action控制逻辑简化为统一的pause状态管理 在MissionComp初始化时确保pause状态正确重置
This commit is contained in:
@@ -162,7 +162,7 @@ export class MissionComp extends CCComp {
|
||||
open_Victory(e:any,is_hero_dead: boolean = false){
|
||||
// 暂停游戏循环和怪物行为
|
||||
// smc.mission.play = false;
|
||||
smc.mission.stop_mon_action = true;
|
||||
smc.mission.pause = true;
|
||||
// oops.message.dispatchEvent(GameEvent.FightEnd,{victory:false})
|
||||
console.log("[MissionComp] open_Victory",is_hero_dead,this.revive_times)
|
||||
oops.gui.open(UIID.Victory,{
|
||||
@@ -203,6 +203,7 @@ export class MissionComp extends CCComp {
|
||||
data_init(){
|
||||
//局内数据初始化 smc 数据初始化
|
||||
smc.mission.play = true;
|
||||
smc.mission.pause = false;
|
||||
smc.mission.stop_mon_action = false;
|
||||
smc.vmdata.mission_data.in_fight=false
|
||||
smc.vmdata.mission_data.fight_time=0
|
||||
|
||||
@@ -51,8 +51,6 @@ export class VictoryComp extends CCComp {
|
||||
|
||||
this.node.getChildByName("btns").getChildByName("next").active=!args.can_revive
|
||||
this.node.getChildByName("btns").getChildByName("alive").active=args.can_revive
|
||||
smc.mission.pause=true
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +97,7 @@ export class VictoryComp extends CCComp {
|
||||
|
||||
// 3. 恢复游戏状态
|
||||
// smc.mission.play = true;
|
||||
smc.mission.stop_mon_action = false;
|
||||
smc.mission.pause = false;
|
||||
|
||||
// 4. 关闭结算界面
|
||||
oops.gui.removeByNode(this.node);
|
||||
|
||||
Reference in New Issue
Block a user