private void TryCreateGestureTwoFingerGestureOnTouchBeganForTouchIndex <T>(int touchIndex, Func <Touch, Touch, T> createGestureFunction) where T : BaseGesture { if (GestureTouches.touches[touchIndex].phase != null) { return; } Touch touch = GestureTouches.touches[touchIndex]; if (GestureTouches.IsFingerIdRetained(touch.fingerId) || GestureTouches.IsTouchOffScreenEdge(touch, edgeThresholdInches)) { return; } for (int i = 0; i < GestureTouches.touches.Length; i++) { if (i != touchIndex) { if (i >= touchIndex || GestureTouches.touches[i].phase != null) { Touch touch2 = GestureTouches.touches[i]; if (!GestureTouches.IsFingerIdRetained(touch2.fingerId) && !GestureTouches.IsTouchOffScreenEdge(touch2, edgeThresholdInches)) { m_Gestures.Add(createGestureFunction(touch, touch2)); } } } } }
protected void TryCreateOneFingerGestureOnTouchBegan <T>(Func <Touch, T> createGestureFunction) where T : BaseGesture { for (int i = 0; i < GestureTouches.touches.Length; i++) { Touch touch = GestureTouches.touches[i]; if (touch.phase == null && !GestureTouches.IsFingerIdRetained(touch.fingerId) && ! GestureTouches.IsTouchOffScreenEdge(touch, edgeThresholdInches)) { m_Gestures.Add(createGestureFunction(touch)); } } }