添加广播逻辑
This commit is contained in:
@@ -6,6 +6,7 @@ import { DOStage } from "../models/DOStage";
|
||||
import { config } from "../constants/config";
|
||||
import { StorageManager } from "../models/StorageManager";
|
||||
import { Utility_ConvertSecondToString } from "../utils/utility";
|
||||
import { EVENT_TYPES, EventManager } from "../models/EventManager";
|
||||
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
@@ -54,9 +55,9 @@ export class Stage extends Laya.Script {
|
||||
private data: DOStage;
|
||||
private selectedBlock: Block;
|
||||
|
||||
|
||||
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||
private static _instance: Stage
|
||||
onAwake(): void {
|
||||
Stage._instance = this
|
||||
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
|
||||
UIManager.getInstance().loadHomeUI();
|
||||
UIManager.getInstance().closeStageUI();
|
||||
@@ -97,6 +98,18 @@ export class Stage extends Laya.Script {
|
||||
this.btn_hint_normal = this.btn_hint.getChildByName("Image").getChildByName("normal") as Laya.Box
|
||||
this.btn_hint_ad = this.btn_hint.getChildByName("Image").getChildByName("ad") as Laya.Box
|
||||
this.btn_hint_label = this.btn_hint.getChildByName("Image").getChildByName("normal").getChildByName("label") as Laya.Label
|
||||
|
||||
EventManager.getInstance().RegisterEvent(EVENT_TYPES.NOT_UPDATE_MISTAKE, Stage.EventUpdateMistak)
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
EventManager.getInstance().UnregisterEvent(EVENT_TYPES.NOT_UPDATE_MISTAKE, Stage.EventUpdateMistak)
|
||||
}
|
||||
|
||||
public static EventUpdateMistak(arg: any): void {
|
||||
if (Stage._instance) {
|
||||
Stage._instance.onUpdateMistake()
|
||||
}
|
||||
}
|
||||
|
||||
public onLoadStage(doStage: DOStage): void {
|
||||
|
||||
Reference in New Issue
Block a user