Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XInputSupport.cs 1.3KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ////TODO: add support for Windows.Gaming.Input.Gamepad (including the trigger motors)
  2. using UnityEngine.InputSystem.Layouts;
  3. namespace UnityEngine.InputSystem.XInput
  4. {
  5. /// <summary>
  6. /// Adds support for XInput controllers.
  7. /// </summary>
  8. #if UNITY_DISABLE_DEFAULT_INPUT_PLUGIN_INITIALIZATION
  9. public
  10. #else
  11. internal
  12. #endif
  13. static class XInputSupport
  14. {
  15. public static void Initialize()
  16. {
  17. // Base layout for Xbox-style gamepad.
  18. InputSystem.RegisterLayout<XInputController>();
  19. ////FIXME: layouts should always be available in the editor (mac/win/linux)
  20. #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA
  21. InputSystem.RegisterLayout<XInputControllerWindows>(
  22. matches: new InputDeviceMatcher().WithInterface("XInput"));
  23. #endif
  24. #if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
  25. InputSystem.RegisterLayout<XboxGamepadMacOS>(
  26. matches: new InputDeviceMatcher().WithInterface("HID")
  27. .WithProduct("Xbox.*Wired Controller"));
  28. InputSystem.RegisterLayout<XboxOneGampadMacOSWireless>(
  29. matches: new InputDeviceMatcher().WithInterface("HID")
  30. .WithProduct("Xbox.*Wireless Controller"));
  31. #endif
  32. }
  33. }
  34. }