Ejemplo n.º 1
0
 public void StopListenForStationary(HandleTouchInfoDelegate handler)
 {
     HandleStationary -= handler;
 }
Ejemplo n.º 2
0
 public void ListenForEnd(HandleTouchInfoDelegate handler)
 {
     HandleEnd += handler;
 }
Ejemplo n.º 3
0
 public void StopListenForEnd(HandleTouchInfoDelegate handler)
 {
     HandleEnd -= handler;
 }
Ejemplo n.º 4
0
 public void StopListenForMove(HandleTouchInfoDelegate handler)
 {
     HandleMove -= handler;
 }
Ejemplo n.º 5
0
    public void ListenForMultiTapsOnCollider(OverlapPointDelegate overlapPoint, int tapCount, float maxTime, HandleTouchInfoDelegate handler)
    {
        int count = 0;

        TouchInfo[] taps = new TouchInfo[tapCount];

        ListenForTouches(TouchAreaHandlerSimple(overlapPoint, (touch) =>
        {
            while (touch.m_startTime - taps[0].m_startTime > maxTime)
            {
                for (int i = 1; i < count; i++)
                {
                    taps[i - 1] = taps[i];
                }
            }

            if (count < tapCount - 1)
            {
                taps[count] = touch;
                count++;
            }
            else
            {
                count = 0;
                handler(touch);
            }
        }));
    }
Ejemplo n.º 6
0
 private static HandleTouchInfoDelegate TouchAreaHandlerSimple(OverlapPointDelegate overlapPoint, HandleTouchInfoDelegate handler, Camera camera = null)
 {
     return(touch =>
     {
         bool overlap = overlapPoint(touch.WorldPosition(camera));
         if (overlap)
         {
             handler(touch);
         }
     });
 }
Ejemplo n.º 7
0
 public void ListenForTouchesOnOverlapSimple(OverlapPointDelegate overlapPoint, HandleTouchInfoDelegate handler, Camera camera = null)
 {
     ListenForTouches(TouchAreaHandlerSimple(overlapPoint, handler, camera));
 }
Ejemplo n.º 8
0
 public void ListenForTouches(HandleTouchInfoDelegate handler)
 {
     HandleTouches += handler;
 }