EventManager.removeAllEventListeners C# (CSharp) Méthode

removeAllEventListeners() public méthode

public removeAllEventListeners ( GameObject listener ) : void
listener GameObject
Résultat void
    public void removeAllEventListeners(GameObject listener)
    {
        ArrayList removeList; // create remove list to not break the enumerator
        ArrayList listenerList;
        foreach (DictionaryEntry listenerListObj in _listeners) {
            listenerList = listenerListObj.Value as ArrayList;
            removeList = new ArrayList();
            // find and add to remove list
         			foreach (EventListener callback in listenerList) {
                if (callback.listener != null) {
                    if (callback.name == listener.GetInstanceID().ToString()) {
                        removeList.Add(callback);
                    }
                }
            }
            // remove from list
            foreach (EventListener callback in removeList) {
                listenerList.Remove(callback);
            }
        }
    }