add trophy logic
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user