Пример #1
0
 /// <summary>
 /// Remove Event Listener
 /// Removes an event listener to specific KIX events of type.
 /// </summary>
 /// <param name="evtType">KIXEventType</param>
 /// <param name="method">Action<KIXEvent></param>
 public void RemoveEventListener(KIXEventType evtType, Action <KIXEvent> method)
 {
     listeners_[evtType.ToString()]?.Remove(method);
     if (listeners_[evtType.ToString()].Count == 0)
     {
         listeners_.Remove(evtType.ToString());
     }
 }
Пример #2
0
 /// <summary>
 /// Add Event Listener
 /// Adds an event listener to specific KIX events of type.
 /// </summary>
 /// <param name="evtType">KIXEventType</param>
 /// <param name="method">Action<KIXEvent></param>
 public void AddEventListener(KIXEventType evtType, Action <KIXEvent> method)
 {
     if (!listeners_.ContainsKey(evtType.ToString()))
     {
         listeners_[evtType.ToString()] = new List <Action <KIXEvent> >();
     }
     listeners_[evtType.ToString()].Add(method);
 }
Пример #3
0
 /// <summary>
 /// Remove Event Listener
 /// Removes a listener for specific KIX events
 /// </summary>
 /// <param name="evtType">KIXEventType</param>
 /// <param name="proxy">Action<KIXEvent></param>
 public void RemoveEventListener(KIXEventType evtType, Action <KIXEvent> proxy)
 {
     KIX.Instance.RemoveEventListener(evtType, proxy);
 }
Пример #4
0
 public KIXEvent(KIXEventType t, KIXData data = new KIXData())
 {
     Type = t.Value;
     Data = data;
 }