private void InvokeEventCaller(AiukUnityEventType type) { if (!m_EventCallers.ContainsKey(type)) { return; } m_EventCallers[type].CallEventHanlder(); }
/// <summary> /// 移除一个Unity类型的事件处理器。 /// </summary> /// <param name="type">Type.</param> /// <param name="action">Action.</param> public void RemoveUnityEvent(AiukUnityEventType type, Action action) { if (!m_EventCallers.ContainsKey(type)) { #if UNITY_EDITOR || DEBUG AiukDebugUtility.LogWarning( string.Format("尝试移除一个不存在的Unity事件类型,事件类型为{0}", type)); #endif return; } var caller = m_EventCallers[type]; caller.RemoveHandler(action); }
public void WatchUnityEvent(AiukUnityEventType type, Action action, int executeCount = -1) { if (!m_EventCallers.ContainsKey(type)) { var newCaller = new AiukTallyEventHandlerCaller(); newCaller.AddHandler(action, executeCount); m_EventCallers.Add(type, newCaller); } else { var caller = m_EventCallers[type]; caller.AddHandler(action, executeCount); } }
public void RemoveUnityEvent(AiukUnityEventType type, Action action) { m_EventComponent.RemoveUnityEvent(type, action); }
public void WatchUnityEvent(AiukUnityEventType type, Action action, int executeCount = -1) { m_EventComponent.WatchUnityEvent(type, action, executeCount); }