Ejemplo n.º 1
0
    private void OnValidate()
    {
        InputDeviceCharacteristics leftHand  = InputDeviceCharacteristics.Left;
        InputDeviceCharacteristics rightHand = InputDeviceCharacteristics.Right;

        if (!_controllerCharacteristics.HasFlag(leftHand) && !_controllerCharacteristics.HasFlag(rightHand))
        {
            Debug.LogWarning("Accept only one Left or Right" + _controllerCharacteristics);
            _controllerCharacteristics = InputDeviceCharacteristics.None;
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Used to get the preferredhand which this controller is.
 /// </summary>
 /// <returns>the correct preferredhand</returns>
 public PreferredHand GetPreferredHand()
 {
     if (hand.HasFlag(InputDeviceCharacteristics.Left))
     {
         return(PreferredHand.Left);
     }
     else if (hand.HasFlag(InputDeviceCharacteristics.Right))
     {
         return(PreferredHand.Right);
     }
     else
     {
         return(PreferredHand.Hmd);
     }
 }
 public bool IsCorrectInputDevice(InputDeviceCharacteristics theHand)
 {
     if (device.HasFlag(theHand))
     {
         return(true);
     }
     return(false);
 }