diff --git a/src/views/Stage.ts b/src/views/Stage.ts index 65b6b29..f2011ca 100644 --- a/src/views/Stage.ts +++ b/src/views/Stage.ts @@ -143,6 +143,16 @@ export class Stage extends Laya.Script { this.btn_hint_ad = this.btn_hint.getChildByName("Image").getChildByName("ad") as Laya.Box this.btn_hint_label = this.btn_hint.getChildByName("Image").getChildByName("normal").getChildByName("label") as Laya.Label + + //失去舞台焦点(切出游戏)的处理 + Laya.stage.on(Laya.Event.BLUR, this, () => { + Stage.EventUpdatePause(true) + }) + //获得舞台焦点(切回游戏)的处理 + Laya.stage.on(Laya.Event.FOCUS, this, () => { + Stage.EventUpdatePause(false) + }) + EventManager.getInstance().RegisterEvent(EVENT_TYPES.NOT_UPDATE_MISTAKE, Stage.EventUpdateMistake) EventManager.getInstance().RegisterEvent(EVENT_TYPES.NOT_UPDATE_PAUSE, Stage.EventUpdatePause) } diff --git a/src/views/dc/DailyChallenge.ts b/src/views/dc/DailyChallenge.ts index 2cd57bd..2c515eb 100644 --- a/src/views/dc/DailyChallenge.ts +++ b/src/views/dc/DailyChallenge.ts @@ -12,7 +12,6 @@ const { regClass, property } = Laya export class DailyChallenge extends Laya.Script { declare owner: Laya.Box - @property(Laya.Sprite) public sprite_bottom: Laya.Sprite @@ -306,7 +305,5 @@ export class DailyChallenge extends Laya.Script { UIManager.getInstance().loadTrophyClaimUI(find) user.set_trophyNew(find, false) } - } - }