继续补充横屏逻辑

This commit is contained in:
2025-05-26 21:17:05 +08:00
parent 12b16320e6
commit 4e0e536c49
5 changed files with 45 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ import { DOStage } from "./DOStage"
import { GamePause } from "../views/GamePause"
import { GameOver } from "../views/GameOver"
import { GameDone } from "../views/GameDone"
import { TopBar } from "../views/TopBar"
const { regClass, property } = Laya
@@ -44,7 +45,7 @@ export class UIManager extends Laya.Script {
return this.UIRoot
}
private topbar : TopBar
private stage: Stage
private dc_ui: DailyChallenge
private trophyRoom: TrophyRoom
@@ -70,9 +71,14 @@ export class UIManager extends Laya.Script {
public loadTopBarUI(): void {
Laya.loader.load(respath.topbar_ui_res).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
this.topbar = this.getUIRoot().addChild(prefab).getComponent(TopBar)
})
}
public setTopbarTo(isClassic: boolean): void {
if (this.topbar) {
this.topbar.onClickTab(isClassic)
}
}
public loadDCUI(): void {
Laya.loader.load(respath.dc_ui_res()).then((go)=>{