UIRoot
This commit is contained in:
@@ -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)=>{
|
||||
|
||||
Reference in New Issue
Block a user