add trophy logic

This commit is contained in:
2025-05-22 14:54:48 +08:00
parent 16a5eb9e6b
commit 2bf07ab8f6
27 changed files with 587 additions and 127 deletions

View File

@@ -2,6 +2,9 @@ import { respath } from "../constants/respath"
import { StorageManager } from "./StorageManager"
import { Stage } from "../views/Stage"
import { DailyChallenge } from "../views/DailyChallenge"
import { TrophyRecord } from "../types/global"
import { TrophyClaim } from "../views/TrophyClaim"
import { TrophyShow } from "../views/TrophyShow"
const { regClass, property } = Laya
@@ -45,6 +48,14 @@ export class UIManager extends Laya.Script {
})
}
public loadTrophyClaimUI(record: TrophyRecord): void {
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)
})
}
public loadTrophyUI(): void {
Laya.loader.load(respath.trophy_ui_res).then((go)=>{
var prefab = go.create()
@@ -52,6 +63,14 @@ export class UIManager extends Laya.Script {
})
}
public loadTrophyShowUI(record: TrophyRecord): void {
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)
})
}
public loadStageUI(stageID: string): void {
if (this.stage) {
this.stage.onLoadStage(StorageManager.getInstance().loadStage(stageID))