This commit is contained in:
2025-05-26 20:56:15 +08:00
parent 468f40351d
commit 12b16320e6
10 changed files with 79 additions and 23 deletions

View File

@@ -103,6 +103,13 @@ export class StorageManager {
return null
}
public cleanStage(stageID: string): void {
if (this.stageMap.has(stageID)) {
this.stageMap.delete(stageID)
}
Laya.LocalStorage.removeItem(stageID)
}
public loadStage(stageID: string): DOStage {//载入关卡
var doStage = this.getStage(stageID)
if (doStage) {

View File

@@ -20,10 +20,36 @@ export class UIManager extends Laya.Script {
declare owner: Laya.Scene
private static _instance: UIManager
public static getInstance(): UIManager {
return UIManager._instance
}
onAwake(): void {
UIManager._instance = this
}
private UIRoot: Laya.Panel
public getUIRoot(): Laya.Node {
if (this.UIRoot == null) {
this.UIRoot = this.owner.getChildByName("UIRoot") as Laya.Panel
if (config.H_SCREEN) {
this.UIRoot.width = config.DESIGN_HEIGHT
this.UIRoot.height = config.DESIGN_WIDTH
}
else {
this.UIRoot.width = config.DESIGN_WIDTH
this.UIRoot.height = config.DESIGN_HEIGHT
}
}
return this.UIRoot
}
private stage: Stage
private dc_ui: DailyChallenge
private trophyRoom: TrophyRoom
onStart(): void {
if (config.H_SCREEN) {
this.loadTopBarUI()
@@ -33,18 +59,6 @@ export class UIManager extends Laya.Script {
}
}
public static getInstance(): UIManager {
return UIManager._instance
}
private stage: Stage
private dc_ui: DailyChallenge
private trophyRoom: TrophyRoom
public getUIRoot(): Laya.Node {
return this.owner
}
public loadHomeUI(): void {
Laya.loader.load(respath.home_ui_res).then((go)=>{