添加加载遮罩
This commit is contained in:
@@ -13,7 +13,7 @@ import { Stage } from "../views/Stage"
|
||||
import { TopBar } from "../views/TopBar"
|
||||
import { StorageManager } from "./StorageManager"
|
||||
|
||||
const { regClass } = Laya
|
||||
const { regClass, property } = Laya
|
||||
|
||||
@regClass()
|
||||
export class UIManager extends Laya.Script {
|
||||
@@ -24,8 +24,15 @@ export class UIManager extends Laya.Script {
|
||||
return UIManager._instance
|
||||
}
|
||||
|
||||
@property(Laya.Image)
|
||||
public mask: Laya.Image
|
||||
|
||||
onAwake(): void {
|
||||
UIManager._instance = this
|
||||
this.mask.on(Laya.Event.CLICK, this, ()=>{
|
||||
console.log("on click mask >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
|
||||
})
|
||||
this.mask.visible = false
|
||||
}
|
||||
|
||||
private UIRoot: Laya.Panel
|
||||
@@ -77,10 +84,12 @@ export class UIManager extends Laya.Script {
|
||||
}
|
||||
|
||||
public loadDCUI(): void {
|
||||
this.mask.visible = true
|
||||
Laya.loader.load(respath.dc_ui_res()).then((go) => {
|
||||
const prefab = go.create()
|
||||
this.dc_ui = this.getUIRoot().addChild(prefab).getComponent(DailyChallenge)
|
||||
this.dc_ui.loadWithMonth()
|
||||
this.mask.visible = false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -100,9 +109,11 @@ export class UIManager extends Laya.Script {
|
||||
}
|
||||
|
||||
public loadTrophyUI(): void {
|
||||
this.mask.visible = true
|
||||
Laya.loader.load(respath.trophy_ui_res()).then((go) => {
|
||||
const prefab = go.create()
|
||||
this.trophyRoom = this.getUIRoot().addChild(prefab).getComponent(TrophyRoom)
|
||||
this.mask.visible = false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ export class DailyChallenge extends Laya.Script {
|
||||
this.selectedUnit.setSelected(true)
|
||||
|
||||
const stageID = `${unit.year}-${unit.month}-${unit.day}`
|
||||
this.label_date.text = `${config.MONTH_ABBRS[unit.month - 1]} ${unit.day},${unit.year}`
|
||||
this.label_date.text = `${config.MONTH_ABBRS[unit.month - 1]} ${unit.day}, ${unit.year}`
|
||||
const user = StorageManager.getInstance().getUser()
|
||||
const progress = user.get_done(stageID)
|
||||
// console.log("onApplyUnit >>>>>", stageID, progress)
|
||||
|
||||
Reference in New Issue
Block a user