export class DispatcherManager {
    private static disispatcher: Laya.EventDispatcher;
    private static get Disispatcher(): Laya.EventDispatcher {
        return DispatcherManager.disispatcher || (DispatcherManager.disispatcher = new Laya.EventDispatcher());
    }

    public static on(type: string, call: any, data: any): void {
        this.Disispatcher.on(type, call, data);
    }
    public static off(type: string, call: any, data: any): void {
        this.Disispatcher.off(type, call, data);
    }
    public static event(type: string, data: any = null): void {
        this.Disispatcher.event(type, data);
    }
}
export class EventType {
    static Event = {
        CamFollowArg: "CamFollowArg",
        SetAimPos: "SetAimPos",
        RefreshBulletCount: "RefreshBulletCount",
        RefreshRemainEnemyCount: "RefreshRemainEnemyCount",
        GameShowTips: "GameShowTips",

        StartShot: 'StartShot',
        StopShot: 'StopShot',
        ShowMainUi: "ShowMainUi",
        SetMonery: "SetMonery",
        SetStage: "SetStage",
        SetStagePro: "SetStagePro"
    };
/************************************************************************************** */
    private loadUI():void {
        Laya.loader.load(["res/threeDimen/ui/button.png"], Laya.Handler.create(this, function():void {
            var changeActionButton:Laya.Button = Laya.stage.addChild(new Laya.Button("res/threeDimen/ui/button.png", "正常模式")) as Laya.Button;
            changeActionButton.size(160, 40);
            changeActionButton.labelBold = true;
            changeActionButton.labelSize = 30;
            changeActionButton.sizeGrid = "4,4,4,4";
            changeActionButton.scale(Laya.Browser.pixelRatio, Laya.Browser.pixelRatio);
            changeActionButton.pos(Laya.stage.width / 2 - changeActionButton.width * Laya.Browser.pixelRatio / 2, Laya.stage.height - 100 * Laya.Browser.pixelRatio);
            changeActionButton.on(Laya.Event.CLICK, this, function():void {
                if (++this.curStateIndex % 2 == 1) {
                    this.sprite3D.active = false;
                    this.lineSprite3D.active = true;
                    changeActionButton.label = "网格模式";
                } else {
                    this.sprite3D.active = true;
                    this.lineSprite3D.active = false;
                    changeActionButton.label = "正常模式";
                }
            });
        }));
    }
    /************************************************************************************** */
}