继续整理UI
This commit is contained in:
@@ -5,6 +5,7 @@ import { CalendarUnit } from "./CalendarUnit";
|
||||
import { UIManager } from "../../models/UIManager";
|
||||
import { respath } from "../../constants/respath";
|
||||
import { MONTH_LIST } from "../../models/DCManager";
|
||||
import { EVENT_TYPES, EventManager } from "../../models/EventManager";
|
||||
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
@@ -59,7 +60,10 @@ export class DailyChallenge extends Laya.Script {
|
||||
private currentIndex: number
|
||||
private indexMax: number
|
||||
|
||||
private static _instance: DailyChallenge
|
||||
onAwake(): void {
|
||||
DailyChallenge._instance = this
|
||||
|
||||
if (this.btn_back) {
|
||||
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
|
||||
UIManager.getInstance().loadHomeUI()
|
||||
@@ -126,6 +130,18 @@ export class DailyChallenge extends Laya.Script {
|
||||
this.loadWithIndex(this.currentIndex)
|
||||
}
|
||||
})
|
||||
|
||||
EventManager.getInstance().RegisterEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, DailyChallenge.EventUpdateTrophyButton)
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
EventManager.getInstance().UnregisterEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, DailyChallenge.EventUpdateTrophyButton)
|
||||
}
|
||||
|
||||
public static EventUpdateTrophyButton(arg: any): void {
|
||||
if (DailyChallenge._instance) {
|
||||
DailyChallenge._instance.btn_trophy.visible = arg
|
||||
}
|
||||
}
|
||||
|
||||
loadWithMonth(): void {
|
||||
|
||||
Reference in New Issue
Block a user