/// <summary> /// a static interface to fire the logic events, with specified type /// </summary> /// <param name="type">Type.</param> /// <param name="arg">Argument.</param> public static void FireLogicEvent(LogicEvents type, LogicArg arg) { if (logicEvents[(int)type] != null) { arg.type = type; logicEvents [(int)type] (arg); } }
public override void installEvents() { base.installEvents(); EngineEvents.InstallEvents(); if (!LogicEvents.Check()) { Dbg.ERROR_MSG("clientapp::installEvents:逻辑事件检查失败,可能有重名!"); Destroy(this); return; } GameCore.ResourceManager.Instance.Init(); LogicSceneMgr.Instance.Init(); }
/// <summary> /// Unregisters the event. /// </summary> /// <param name="type">Type.</param> /// <param name="handler">Handler.</param> public static void UnregisterEvent(LogicEvents type, LogicHandler handler) { logicEvents [(int)type] -= handler; }