public void RegisterListener(GameEventMultipleListener listener, int index) { if (eventListeners.Find(ltn => ltn.listener == listener) == null) { eventListeners.Add(new ElementListener(listener, index)); } }
public ElementListener(GameEventMultipleListener listener, int index) { this.listener = listener; this.index = index; }
public void UnregisterListener(GameEventMultipleListener listener, int index) { var count = eventListeners.RemoveAll(lmt => lmt.listener == listener && lmt.index == index); }