/// <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()); } }
/// <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); }
/// <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); }
public KIXEvent(KIXEventType t, KIXData data = new KIXData()) { Type = t.Value; Data = data; }