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