12345678910111213141516171819202122232425262728293031 |
- //道具种类
- export enum PropEffecf{NONE,DOUBLE,HAMMER,UP,CLEARLAST,CLEARTWO }
- //舞台状态
- export enum StageMode{ReStart,Start,Lose,Win,Clone,Over,Revive,Refresh,Check};
- export class EventManager{
- private static Instance:Laya.EventDispatcher = new Laya.EventDispatcher();
- public static PropState:PropEffecf = PropEffecf.NONE;
- static EventOn(_mode:PropEffecf,caller:any,fun:Function,args = [])
- {
- EventManager.Instance.on(PropEffecf[_mode],caller,fun,args);
- }
- static EventOff(_mode:PropEffecf,caller:any,fun:Function,args = [])
- {
- EventManager.Instance.off(PropEffecf[_mode],caller,fun);
- }
- static EventTrigger(_mode:PropEffecf,args = [])
- {
- EventManager.Instance.event(PropEffecf[_mode],args);
- EventManager.PropState = _mode;
- }
- static StageOn(_mode:StageMode,caller:any,fun:Function,args = []){
- EventManager.Instance.on(StageMode[_mode],caller,fun,args);
- }
- static StageOff(_mode:StageMode,caller:any,fun:Function,args = []){
- EventManager.Instance.off(StageMode[_mode],caller,fun);
- }
- static StageTrigger(_mode:StageMode,args = []){
- EventManager.Instance.event(StageMode[_mode],args);
- }
- }
|