/// <summary> /// 请求并处理多返回提供器的返回消息 /// </summary> /// <typeparam name="Res"></typeparam> /// <param name="providerType"></param> /// <param name="handler"></param> /// <param name="triggerObject"></param> public static void RequestMultProvider <A1, A2, Res>(string providerType, Action <Res> handler, A1 arg1, A2 arg2, object triggerObject = null) { if (triggerObject == null) { m_eventController.RequestMultProvider <A1, A2, Res>(providerType, handler, arg1, arg2); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.RequestMultProvider <A1, A2, Res>(providerType, handler, arg1, arg2); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(triggerObject); if (controller != null) { controller.RequestMultProvider <A1, A2, Res>(providerType, handler, arg1, arg2); } } }
/// <summary> /// 触发行为 /// </summary> /// <param name="eventType">事件类型</param> /// <param name="triggerObject">触发对象</param> public static void TriggerEvent <T, U, V, W>(string eventType, T arg1, U arg2, V arg3, W arg4, object triggerObject = null) { if (triggerObject == null) { m_eventController.TriggerEvent <T, U, V, W>(eventType, arg1, arg2, arg3, arg4); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.TriggerEvent <T, U, V, W>(eventType, arg1, arg2, arg3, arg4); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(triggerObject); if (controller != null) { controller.TriggerEvent <T, U, V, W>(eventType, arg1, arg2, arg3, arg4); } } }
/// <summary> /// 触发行为 /// </summary> /// <param name="eventType">事件类型</param> /// <param name="triggerObject">触发对象</param> public static void TriggerEvent(string eventType, object triggerObject = null) { if (triggerObject == null) { m_eventController.TriggerEvent(eventType); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.TriggerEvent(eventType); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(triggerObject); if (controller != null) { controller.TriggerEvent(eventType); } } }
public static void TriggerEventWithTag <T, U, V>(string eventType, T arg1, U arg2, V arg3, object tag = null) { if (tag == null) { globelEventController.TriggerEvent <T, U, V>(eventType, arg1, arg2, arg3); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.TriggerEvent <T, U, V>(eventType, arg1, arg2, arg3); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(tag); if (controller != null) { controller.TriggerEvent <T, U, V>(eventType, arg1, arg2, arg3); } } }
public static void TriggerEventWithTag(string eventType, object tag) { if (tag == null) { globelEventController.TriggerEvent(eventType); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.TriggerEvent(eventType); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(tag); if (controller != null) { controller.TriggerEvent(eventType); } } }
/// <summary> /// 请求并处理多返回提供器的返回消息 /// </summary> /// <typeparam name="Res"></typeparam> /// <param name="providerType"></param> /// <param name="handler"></param> /// <param name="tag"></param> public static void RequestMultProvider <A1, A2, A3, A4, Res>(string providerType, Action <Res> handler, A1 arg1, A2 arg2, A3 arg3, A4 arg4, object tag = null) { if (tag == null) { globelEventController.RequestMultProvider <A1, A2, A3, A4, Res>(providerType, handler, arg1, arg2, arg3, arg4); MonoEventDispatcher.DoToAllMonoContorller((con) => { con.RequestMultProvider <A1, A2, A3, A4, Res>(providerType, handler, arg1, arg2, arg3, arg4); }); } else { EventController controller = MonoEventDispatcher.GetMonoController(tag); if (controller != null) { controller.RequestMultProvider <A1, A2, A3, A4, Res>(providerType, handler, arg1, arg2, arg3, arg4); } } }