export enum EventState{LoadComplete,SceneInit,StageInit,ShowModel};
export enum StageState{Win,Lose,Start,BackMain,StageCreateComPlete,Over,Pause,Resume};
export class DispatcherManager
{
    private static instance:Laya.EventDispatcher = new Laya.EventDispatcher();

    static EventOn(_mode:EventState,caller:any,fun:Function,args = [])
    {
        DispatcherManager.instance.on(EventState[_mode],caller,fun,args);
    }
    static EventOff(_mode:EventState,caller:any,fun:Function,args = [])
    {
        DispatcherManager.instance.off(EventState[_mode],caller,fun);
    }
    static EventTrigger(_mode:EventState,args = [])
    {
        DispatcherManager.instance.event(EventState[_mode],args);
    }
    static StageOn(_mode:StageState,caller:any,fun:Function,args = [])
    {
        DispatcherManager.instance.on(StageState[_mode],caller,fun,args);
    }
    static StageOff(_mode:StageState,caller:any,fun:Function,args = [])
    {
        DispatcherManager.instance.off(StageState[_mode],caller,fun);
    }
    static StageTrigger(_mode:StageState,args = [])
    {
        DispatcherManager.instance.event(StageState[_mode],args);
    }
}