Exemple #1
0
    // Token: 0x06005162 RID: 20834 RVA: 0x001BE374 File Offset: 0x001BC774
    private void UpdateGesture()
    {
        float num  = this.swipeDir.x;
        float num2 = this.swipeDir.y;

        if (this.currentGesture == GearPadGestures.Gesture.TapAndHold)
        {
            if (Mathf.Abs(num) > this.gestureThreshhold || Mathf.Abs(num2) > this.gestureThreshhold)
            {
                this.SetGesture(GearPadGestures.Gesture.TapAndHoldCancel);
            }
            else if (Input.GetMouseButtonUp(0))
            {
                this.SetGesture(GearPadGestures.Gesture.TapAndHoldSelect);
            }
        }
        else
        {
            this.currentGesture = GearPadGestures.Gesture.None;
        }
        if (!this.justRecognizedGesture)
        {
            GearPadGestures.Gesture gesture = GearPadGestures.Gesture.None;
            if (Mathf.Abs(num) > Mathf.Abs(num2))
            {
                num2 = 0f;
            }
            else
            {
                num = 0f;
            }
            if (Input.GetMouseButtonDown(0))
            {
                base.StopCoroutine("CheckForTapAndHold");
                base.StartCoroutine("CheckForTapAndHold", 0.5f);
            }
            if (num > this.gestureThreshhold)
            {
                gesture = GearPadGestures.Gesture.Backward;
            }
            else if (num < -this.gestureThreshhold)
            {
                gesture = GearPadGestures.Gesture.Forward;
            }
            else if (num2 > this.gestureThreshhold)
            {
                gesture = GearPadGestures.Gesture.Up;
            }
            else if (num2 < -this.gestureThreshhold)
            {
                gesture = GearPadGestures.Gesture.Down;
            }
            else if (Input.GetMouseButtonUp(0))
            {
                gesture = GearPadGestures.Gesture.Tap;
            }
            if (gesture != GearPadGestures.Gesture.None)
            {
                this.SetGesture(gesture);
            }
        }
    }
Exemple #2
0
 // Token: 0x06005163 RID: 20835 RVA: 0x001BE4B4 File Offset: 0x001BC8B4
 private void SetGesture(GearPadGestures.Gesture gesture)
 {
     this.justRecognizedGesture = true;
 }