添加横屏页面

This commit is contained in:
2025-05-26 19:57:17 +08:00
parent 354194358b
commit 468f40351d
71 changed files with 11796 additions and 42067 deletions

View File

@@ -6,6 +6,11 @@ import { TrophyRecord } from "../types/global"
import { TrophyClaim } from "../views/dc/TrophyClaim"
import { TrophyShow } from "../views/dc/TrophyShow"
import { config } from "../constants/config"
import { TrophyRoom } from "../views/dc/TrophyRoom"
import { DOStage } from "./DOStage"
import { GamePause } from "../views/GamePause"
import { GameOver } from "../views/GameOver"
import { GameDone } from "../views/GameDone"
const { regClass, property } = Laya
@@ -33,6 +38,8 @@ export class UIManager extends Laya.Script {
}
private stage: Stage
private dc_ui: DailyChallenge
private trophyRoom: TrophyRoom
public getUIRoot(): Laya.Node {
@@ -54,15 +61,21 @@ export class UIManager extends Laya.Script {
}
public loadDCUI(): void {
Laya.loader.load(respath.dc_ui_res).then((go)=>{
Laya.loader.load(respath.dc_ui_res()).then((go)=>{
var prefab = go.create()
var dc = this.getUIRoot().addChild(prefab).getComponent(DailyChallenge)
dc.loadWithMonth()
this.dc_ui = this.getUIRoot().addChild(prefab).getComponent(DailyChallenge)
this.dc_ui.loadWithMonth()
})
}
public closeDCUI(): void {
if (this.dc_ui) {
this.dc_ui.owner.destroy()
this.dc_ui = null
}
}
public loadTrophyClaimUI(record: TrophyRecord): void {
Laya.loader.load(respath.trophy_claim_ui_res).then((go)=>{
Laya.loader.load(respath.trophy_claim_ui_res()).then((go)=>{
var prefab = go.create()
var obj = this.getUIRoot().addChild(prefab).getComponent(TrophyClaim)
obj.onSetShow(record)
@@ -70,14 +83,20 @@ export class UIManager extends Laya.Script {
}
public loadTrophyUI(): void {
Laya.loader.load(respath.trophy_ui_res).then((go)=>{
Laya.loader.load(respath.trophy_ui_res()).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
this.trophyRoom = this.getUIRoot().addChild(prefab).getComponent(TrophyRoom)
})
}
public closeTrophyUI(): void {
if (this.trophyRoom) {
this.trophyRoom.owner.destroy()
this.trophyRoom = null
}
}
public loadTrophyShowUI(record: TrophyRecord): void {
Laya.loader.load(respath.trophy_show_ui_res).then((go)=>{
Laya.loader.load(respath.trophy_show_ui_res()).then((go)=>{
var prefab = go.create()
var obj = this.getUIRoot().addChild(prefab).getComponent(TrophyShow)
obj.onSetShow(record)
@@ -103,22 +122,25 @@ export class UIManager extends Laya.Script {
}
}
public loadGamePauseUI(): void {
Laya.loader.load(respath.gamepause_ui_res).then((go)=>{
public loadGamePauseUI(doStage: DOStage): void {
Laya.loader.load(respath.gamepause_ui_res()).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
var ui = this.getUIRoot().addChild(prefab).getComponent(GamePause)
ui.onSetStageInfo(doStage)
})
}
public loadGameOverUI(): void {
Laya.loader.load(respath.gameover_ui_res).then((go)=>{
public loadGameOverUI(doStage: DOStage): void {
Laya.loader.load(respath.gameover_ui_res()).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
var ui = this.getUIRoot().addChild(prefab).getComponent(GameOver)
ui.onSetStageInfo(doStage)
})
}
public loadGameDoneUI(): void {
Laya.loader.load(respath.gamedone_ui_res).then((go)=>{
public loadGameDoneUI(isClassic: boolean, doStage: DOStage): void {
Laya.loader.load(respath.gamedone_ui_res(isClassic)).then((go)=>{
var prefab = go.create()
this.getUIRoot().addChild(prefab)
var ui = this.getUIRoot().addChild(prefab).getComponent(GameDone)
ui.onSetStageInfo(doStage)
})
}