Beispiel #1
0
        public override Vector2 GetScrollDelta()
        {
            var delta = Vector2.zero;

            switch (buttonEventSource)
            {
            case ButtonEventSource.AllButtons:
                delta = ViveInput.GetPadTouchDelta(HandRole.RightHand) + ViveInput.GetPadTouchDelta(HandRole.LeftHand);
                break;

            case ButtonEventSource.RightHandOnly:
                delta = ViveInput.GetPadTouchDelta(HandRole.RightHand);
                break;

            case ButtonEventSource.LeftHandOnly:
                delta = ViveInput.GetPadTouchDelta(HandRole.LeftHand);
                break;
            }
            return(delta * scrollDeltaScale);
        }
 public override bool IsValueChangedThisFrame()
 {
     v2 = ViveInput.GetPadTouchDelta(hand);
     return(!Mathf.Approximately(v2.sqrMagnitude, 0f));
 }