Example #1
0
 private static void HandleInputMouse(ref Vector3 move)
 {
     if (move.magnitude < OVRTouchpad.minMovMagnitudeMouse)
     {
         if (OVRTouchpad.TouchHandler != null)
         {
             OVRTouchpad.TouchHandler(null, new OVRTouchpad.TouchArgs
             {
                 TouchType = OVRTouchpad.TouchEvent.SingleTap
             });
         }
     }
     else
     {
         move.Normalize();
         if (Mathf.Abs(move.x) > Mathf.Abs(move.y))
         {
             if (move.x > 0f)
             {
                 if (OVRTouchpad.TouchHandler != null)
                 {
                     OVRTouchpad.TouchHandler(null, new OVRTouchpad.TouchArgs
                     {
                         TouchType = OVRTouchpad.TouchEvent.Left
                     });
                 }
             }
             else if (OVRTouchpad.TouchHandler != null)
             {
                 OVRTouchpad.TouchHandler(null, new OVRTouchpad.TouchArgs
                 {
                     TouchType = OVRTouchpad.TouchEvent.Right
                 });
             }
         }
         else if (move.y > 0f)
         {
             if (OVRTouchpad.TouchHandler != null)
             {
                 OVRTouchpad.TouchHandler(null, new OVRTouchpad.TouchArgs
                 {
                     TouchType = OVRTouchpad.TouchEvent.Down
                 });
             }
         }
         else if (OVRTouchpad.TouchHandler != null)
         {
             OVRTouchpad.TouchHandler(null, new OVRTouchpad.TouchArgs
             {
                 TouchType = OVRTouchpad.TouchEvent.Up
             });
         }
     }
 }