添加加载时遮挡

This commit is contained in:
2025-06-05 15:14:32 +08:00
parent 9d2a177325
commit c2726c790a
2 changed files with 6 additions and 1 deletions

View File

@@ -1,4 +1,3 @@
import { respath } from "./constants/respath"
import { DCManager } from "./models/DCManager" import { DCManager } from "./models/DCManager"
import { LevelManager } from "./models/LevelManager" import { LevelManager } from "./models/LevelManager"
import { ResourceManager } from "./models/ResourceManager" import { ResourceManager } from "./models/ResourceManager"

View File

@@ -186,26 +186,32 @@ export class UIManager extends Laya.Script {
} }
public loadGamePauseUI(doStage: DOStage): void { public loadGamePauseUI(doStage: DOStage): void {
this.mask.visible = true
Laya.loader.load(respath.gamepause_ui_res()).then((go) => { Laya.loader.load(respath.gamepause_ui_res()).then((go) => {
const prefab = go.create() const prefab = go.create()
const ui = this.getUIRoot().addChild(prefab).getComponent(GamePause) const ui = this.getUIRoot().addChild(prefab).getComponent(GamePause)
ui.onSetStageInfo(doStage) ui.onSetStageInfo(doStage)
this.mask.visible = false
}) })
} }
public loadGameOverUI(doStage: DOStage): void { public loadGameOverUI(doStage: DOStage): void {
this.mask.visible = true
Laya.loader.load(respath.gameover_ui_res()).then((go) => { Laya.loader.load(respath.gameover_ui_res()).then((go) => {
const prefab = go.create() const prefab = go.create()
const ui = this.getUIRoot().addChild(prefab).getComponent(GameOver) const ui = this.getUIRoot().addChild(prefab).getComponent(GameOver)
ui.onSetStageInfo(doStage) ui.onSetStageInfo(doStage)
this.mask.visible = false
}) })
} }
public loadGameDoneUI(isClassic: boolean, doStage: DOStage): void { public loadGameDoneUI(isClassic: boolean, doStage: DOStage): void {
this.mask.visible = true
Laya.loader.load(respath.gamedone_ui_res(isClassic)).then((go) => { Laya.loader.load(respath.gamedone_ui_res(isClassic)).then((go) => {
const prefab = go.create() const prefab = go.create()
const ui = this.getUIRoot().addChild(prefab).getComponent(GameDone) const ui = this.getUIRoot().addChild(prefab).getComponent(GameDone)
ui.onSetStageInfo(doStage) ui.onSetStageInfo(doStage)
this.mask.visible = false
}) })
} }
} }