コード例 #1
0
 public static void OnDeviceDisconnect(Guid id, XRControllerSide side, XRInputControllerType type)
 {
     if (side == XRControllerSide.Left)
     {
         hasLeftController = false;
     }
     if (side == XRControllerSide.Right)
     {
         hasRightController = false;
     }
 }
コード例 #2
0
    public static void OnDeviceConnect(Guid id, XRControllerSide side, XRInputControllerType type)
    {
        if (side == XRControllerSide.Left)
        {
            hasLeftController = true;
        }
        if (side == XRControllerSide.Right)
        {
            hasRightController = true;
        }

        loadedControllerSet = type;
    }
コード例 #3
0
 private void XRInput_ControllerDisconnectedMethod(Guid id, XRControllerSide side, XRInputControllerType type)
 {
     Debug.Log("CALLBACK: XRInput Controller-Disconnected: " + side.ToString());
 }
コード例 #4
0
 private void XRInput_ControllerConnectedCallback(Guid id, XRControllerSide side, XRInputControllerType type)
 {
     Debug.Log("CALLBACK: XRInput Controller-Connected: " + side.ToString());
 }
コード例 #5
0
 private static void TestJoystickEvent(JoystickEvent e, ref XRControllerJoystick joystick, XRControllerSide side)
 {
     if (e != null && joystick.value.magnitude != 0)
     {
         e(side, joystick.value);
     }
 }
コード例 #6
0
 private static void TestAnalogEvent(AnalogEvent e, ref XRControllerAnalog analog, XRControllerSide side)
 {
     if (e != null && analog.value != 0)
     {
         e(side, analog.value);
     }
 }
コード例 #7
0
 private static void TestButtonEvent(ButtonEvent onEvent, ButtonEvent downEvent, ButtonEvent upEvent, ref XRControllerButton button, XRControllerSide side)
 {
     if (onEvent != null && button.on)
     {
         onEvent(side);
     }
     if (downEvent != null && button.down)
     {
         downEvent(side);
     }
     if (upEvent != null && button.up)
     {
         upEvent(side);
     }
 }