コード例 #1
0
    private void TrackTouch(Touch touch)
    {
        if (touch.phase != TouchPhase.Began && Touches.ContainsKey(touch.fingerId))
        {
            Touches[touch.fingerId].UpdateTouchInfo(touch);

            if (touch.phase == TouchPhase.Ended)
            {
                Touches.Remove(touch.fingerId);
            }
            else
            {
                HandleTouches?.Invoke(Touches[touch.fingerId]);
            }
        }
        else if (!Touches.ContainsKey(touch.fingerId))
        {
            TouchInfo newTouch = new TouchInfo(touch);

            Touches.Add(touch.fingerId, newTouch);

            HandleTouches?.Invoke(newTouch);
        }
    }
コード例 #2
0
 public override void TouchesMoved(NSSet touches, UIEvent evt) => HandleTouches?.Invoke(touches);