开始添加横屏UI

This commit is contained in:
2025-05-23 20:47:03 +08:00
parent e0d25affa3
commit 354194358b
31 changed files with 58237 additions and 14257 deletions

View File

@@ -1,10 +1,11 @@
import { respath } from "../constants/respath"
import { StorageManager } from "./StorageManager"
import { Stage } from "../views/Stage"
import { DailyChallenge } from "../views/DailyChallenge"
import { DailyChallenge } from "../views/dc/DailyChallenge"
import { TrophyRecord } from "../types/global"
import { TrophyClaim } from "../views/TrophyClaim"
import { TrophyShow } from "../views/TrophyShow"
import { TrophyClaim } from "../views/dc/TrophyClaim"
import { TrophyShow } from "../views/dc/TrophyShow"
import { config } from "../constants/config"
const { regClass, property } = Laya
@@ -19,7 +20,12 @@ export class UIManager extends Laya.Script {
}
onStart(): void {
this.loadHomeUI()
if (config.H_SCREEN) {
this.loadTopBarUI()
}
else {
this.loadHomeUI()
}
}
public static getInstance(): UIManager {
@@ -39,6 +45,13 @@ export class UIManager extends Laya.Script {
this.getUIRoot().addChild(prefab)
})
}
public loadTopBarUI(): void {
Laya.loader.load(respath.topbar_ui_res).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
})
}
public loadDCUI(): void {
Laya.loader.load(respath.dc_ui_res).then((go)=>{