public static void OnDeviceDisconnect(Guid id, XRControllerSide side, XRInputControllerType type) { if (side == XRControllerSide.Left) { hasLeftController = false; } if (side == XRControllerSide.Right) { hasRightController = false; } }
public static void OnDeviceConnect(Guid id, XRControllerSide side, XRInputControllerType type) { if (side == XRControllerSide.Left) { hasLeftController = true; } if (side == XRControllerSide.Right) { hasRightController = true; } loadedControllerSet = type; }
private void XRInput_ControllerDisconnectedMethod(Guid id, XRControllerSide side, XRInputControllerType type) { Debug.Log("CALLBACK: XRInput Controller-Disconnected: " + side.ToString()); }
private void XRInput_ControllerConnectedCallback(Guid id, XRControllerSide side, XRInputControllerType type) { Debug.Log("CALLBACK: XRInput Controller-Connected: " + side.ToString()); }
private static void TestJoystickEvent(JoystickEvent e, ref XRControllerJoystick joystick, XRControllerSide side) { if (e != null && joystick.value.magnitude != 0) { e(side, joystick.value); } }
private static void TestAnalogEvent(AnalogEvent e, ref XRControllerAnalog analog, XRControllerSide side) { if (e != null && analog.value != 0) { e(side, analog.value); } }
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); } }