开始添加横屏UI
This commit is contained in:
@@ -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)=>{
|
||||
|
||||
Reference in New Issue
Block a user