Example #1
0
    public void OnPointerDown(PointerEventData eventData)
    {
        var touchId = eventData.pointerId;

        if (ContainsTouchId(touchId))
        {
            return;
        }
        if (touchId1 == -1)
        {
            touchId1 = touchId;
            AddTouchId(touchId);
        }
        else if (touchId2 == -1)
        {
            touchId2 = touchId;
            AddTouchId(touchId);
        }
        if (touchId1 != -1 && touchId2 != -1)
        {
            CacheMobileSwipeArea.enabled = false;
            CacheMobilePinchArea.enabled = true;
            CacheMobilePinchArea.OnPointerDown(touchId1);
            CacheMobilePinchArea.OnPointerDown(touchId2);
        }
        else if (touchId1 != -1 || touchId2 != -1)
        {
            CacheMobileSwipeArea.enabled = true;
            CacheMobilePinchArea.enabled = false;
            CacheMobileSwipeArea.OnPointerDown(touchId1);
            CacheMobileSwipeArea.OnPointerDown(touchId2);
        }
    }
Example #2
0
 public void OnPointerDown(PointerEventData eventData)
 {
     ++pointerCount;
     if (pointerCount == 2)
     {
         CacheMobilePinchArea.OnPointerDown(eventData);
     }
     if (pointerCount == 1)
     {
         CacheMobilePinchArea.OnPointerDown(eventData);
         CacheMobileSwipeArea.OnPointerDown(eventData);
     }
 }