Beispiel #1
0
            private void InvokeEventCaller(AiukUnityEventType type)
            {
                if (!m_EventCallers.ContainsKey(type))
                {
                    return;
                }

                m_EventCallers[type].CallEventHanlder();
            }
Beispiel #2
0
            /// <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);
            }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 public void RemoveUnityEvent(AiukUnityEventType type, Action action)
 {
     m_EventComponent.RemoveUnityEvent(type, action);
 }
Beispiel #5
0
 public void WatchUnityEvent(AiukUnityEventType type, Action action, int executeCount = -1)
 {
     m_EventComponent.WatchUnityEvent(type, action, executeCount);
 }