Exemplo n.º 1
0
    public void remove(ITouchListener listener)
    {
        int id = listener.GetHashCode();

        if (beganListeners != null)
        {
            for (int i = 0, c = beganListeners.Count; i < c; ++i)
            {
                /*if (beganListeners[i] == null)
                 *      continue;*/
                if (id == beganListeners[i].GetHashCode())
                {
                    //beganListeners[i] = null;
                    beganListeners.RemoveAt(i);
                    break;
                }
            }
        }

        if (stationaryListeners != null)
        {
            for (int i = 0, c = stationaryListeners.Count; i < c; ++i)
            {
                /*if (stationaryListeners[i] == null)
                 *      continue;*/
                if (id == stationaryListeners[i].GetHashCode())
                {
                    //stationaryListeners[i] = null;
                    stationaryListeners.RemoveAt(i);
                    break;
                }
            }
        }

        if (endedListeners != null)
        {
            for (int i = 0, c = endedListeners.Count; i < c; ++i)
            {
                /*if (endedListeners[i] == null)
                 *      continue;*/
                if (id == endedListeners[i].GetHashCode())
                {
                    //endedListeners[i] = null;
                    endedListeners.RemoveAt(i);
                    break;
                }
            }
        }
        // add here if else for other traverses for different touch phases
    }
Exemplo n.º 2
0
    public void remove(ITouchListener listener)
    {
        int id = listener.GetHashCode();

        for (int i = 0, c = beganListeners.Length; i < c; ++i)
        {
            if (beganListeners[i] == null)
            {
                continue;
            }
            if (id == beganListeners[i].GetHashCode())
            {
                beganListeners[i] = null;
                break;
            }
        }

        for (int i = 0, c = stationaryListeners.Length; i < c; ++i)
        {
            if (stationaryListeners[i] == null)
            {
                continue;
            }
            if (id == stationaryListeners[i].GetHashCode())
            {
                stationaryListeners[i] = null;
                break;
            }
        }

        for (int i = 0, c = endedListeners.Length; i < c; ++i)
        {
            if (endedListeners[i] == null)
            {
                continue;
            }
            if (id == endedListeners[i].GetHashCode())
            {
                endedListeners[i] = null;
                break;
            }
        }
    }