diff --git a/.gitignore b/.gitignore index 674e14a..e4d4c75 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ BinariesX86/ BinariesX64/ XInputUnity4/Library/ XInputUnity5/Library/ +XInputUnity5/Assets/AssetStoreTools* Temp/ \ No newline at end of file diff --git a/Build/UpdateUnityProject.bat b/Build/UpdateUnityProject.bat index 88e2f91..3e829c7 100644 --- a/Build/UpdateUnityProject.bat +++ b/Build/UpdateUnityProject.bat @@ -4,7 +4,10 @@ setlocal call BuildCurrentBranch.bat call :copyToUnity ..\XInputUnity4 +copy ..\BinariesX86\Release\XInputInterface.dll ..\XInputUnity4\ + call :copyToUnity ..\XInputUnity5 + exit /b 0 :copyToUnity @@ -12,11 +15,8 @@ setlocal if not exist %1\Assets\XInputDotNet\Plugins\x86 md %1\Assets\XInputDotNet\Plugins\x86 if not exist %1\Assets\XInputDotNet\Plugins\x86_64 md %1\Assets\XInputDotNet\Plugins\x86_64 -copy ..\BinariesX86\Release\XInputInterfaceX86.dll %1\Assets\XInputDotNet\Plugins\x86\ -copy ..\BinariesX86\Release\XInputInterfaceX86.dll %1\ -copy ..\BinariesX86\Release\XInputDotNetPure.dll %1\Assets\XInputDotNet\Plugins\x86\ +copy ..\BinariesX86\Release\XInputDotNetPure.dll %1\Assets\XInputDotNet\Plugins\ -copy ..\BinariesX64\Release\XInputInterfaceX64.dll %1\Assets\XInputDotNet\Plugins\x86_64\ -copy ..\BinariesX64\Release\XInputInterfaceX64.dll %1\ -copy ..\BinariesX64\Release\XInputDotNetPure.dll %1\Assets\XInputDotNet\Plugins\x86_64\ +copy ..\BinariesX86\Release\XInputInterface.dll %1\Assets\XInputDotNet\Plugins\x86\ +copy ..\BinariesX64\Release\XInputInterface.dll %1\Assets\XInputDotNet\Plugins\x86_64\ endlocal diff --git a/README.md b/README.md index 9973b91..625d771 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,17 @@ Some examples are available in this repository : #### error CS1704: An assembly with the same name `XInputDotNetPure' has already been imported. -If you get this error, or a similar one, make sure the settings for each architecture matches the settings below. +If you get this error, or a similar one, make sure the settings for each file matches the settings below. +For `Plugins\x86\XInputInterface.dll` ![Plugin settings for x86 DLLs](https://raw.github.com/speps/XInputDotNet/master/SettingsX86.jpg) +For `Plugins\x86_64\XInputInterface.dll` ![Plugin settings for x86_64 DLLs](https://raw.github.com/speps/XInputDotNet/master/SettingsX64.jpg) +For `Plugins\XInputDotNetPure.dll` +![Plugin settings for AnyCPU DLLs](https://raw.github.com/speps/XInputDotNet/master/SettingsAnyCPU.jpg) + #### Special instructions for Free version of Unity NOTE: this is needed only for Unity 4, Unity 5 seems to have the right behaviour diff --git a/SettingsAnyCPU.jpg b/SettingsAnyCPU.jpg new file mode 100644 index 0000000..cf01ac2 Binary files /dev/null and b/SettingsAnyCPU.jpg differ diff --git a/XInputDotNetPure/GamePad.cs b/XInputDotNetPure/GamePad.cs index ea98a14..4b6f720 100644 --- a/XInputDotNetPure/GamePad.cs +++ b/XInputDotNetPure/GamePad.cs @@ -5,11 +5,7 @@ namespace XInputDotNetPure { class Imports { -#if WIN64 - internal const string DLLName = "XInputInterfaceX64"; -#else - internal const string DLLName = "XInputInterfaceX86"; -#endif + internal const string DLLName = "XInputInterface"; [DllImport(DLLName)] public static extern uint XInputGamePadGetState(uint playerIndex, out GamePadState.RawState state); diff --git a/XInputDotNetPure/XInputDotNetPure.csproj b/XInputDotNetPure/XInputDotNetPure.csproj index 91116d8..8090840 100644 --- a/XInputDotNetPure/XInputDotNetPure.csproj +++ b/XInputDotNetPure/XInputDotNetPure.csproj @@ -26,7 +26,7 @@ TRACE true pdbonly - x86 + AnyCPU prompt @@ -42,10 +42,10 @@ ..\BinariesX64\Release\ - TRACE;WIN64 + TRACE true pdbonly - x64 + AnyCPU prompt false false diff --git a/XInputInterface/XInputInterface.vcxproj b/XInputInterface/XInputInterface.vcxproj index 4ec0ccd..ea22703 100644 --- a/XInputInterface/XInputInterface.vcxproj +++ b/XInputInterface/XInputInterface.vcxproj @@ -81,18 +81,10 @@ false false - - $(ProjectName)X86 - - - $(ProjectName)X86 - - - $(ProjectName)X64 - - - $(ProjectName)X64 - + + + + Disabled diff --git a/XInputUnity4/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll new file mode 100644 index 0000000..6e7df91 Binary files /dev/null and b/XInputUnity4/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll differ diff --git a/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll deleted file mode 100644 index b881dfb..0000000 Binary files a/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll and /dev/null differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll similarity index 95% rename from XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll rename to XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll index 6c50726..72d21be 100644 Binary files a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll and b/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll differ diff --git a/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll deleted file mode 100644 index fb2634d..0000000 Binary files a/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll and /dev/null differ diff --git a/XInputUnity4/XInputInterfaceX64.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll similarity index 99% rename from XInputUnity4/XInputInterfaceX64.dll rename to XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll index c6fe75c..b9551df 100644 Binary files a/XInputUnity4/XInputInterfaceX64.dll and b/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll differ diff --git a/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll b/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll deleted file mode 100644 index c6fe75c..0000000 Binary files a/XInputUnity4/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll and /dev/null differ diff --git a/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll b/XInputUnity4/XInputInterface.dll similarity index 95% rename from XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll rename to XInputUnity4/XInputInterface.dll index 6c50726..72d21be 100644 Binary files a/XInputUnity4/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll and b/XInputUnity4/XInputInterface.dll differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll b/XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll new file mode 100644 index 0000000..6e7df91 Binary files /dev/null and b/XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll.meta b/XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll.meta similarity index 95% rename from XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll.meta rename to XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll.meta index 53081a6..0a1487e 100644 --- a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll.meta +++ b/XInputUnity5/Assets/XInputDotNet/Plugins/XInputDotNetPure.dll.meta @@ -23,7 +23,7 @@ PluginImporter: Exclude OSXIntel: 1 Exclude OSXIntel64: 1 Exclude OSXUniversal: 1 - Exclude Win: 1 + Exclude Win: 0 Exclude Win64: 0 data: first: @@ -31,7 +31,7 @@ PluginImporter: second: enabled: 0 settings: - CPU: x86_64 + CPU: AnyCPU OS: Windows data: first: @@ -61,7 +61,7 @@ PluginImporter: second: enabled: 0 settings: - CPU: None + CPU: AnyCPU data: first: Facebook: Win64 @@ -115,9 +115,9 @@ PluginImporter: first: Standalone: Win second: - enabled: 0 + enabled: 1 settings: - CPU: None + CPU: AnyCPU data: first: Standalone: Win64 diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll b/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll deleted file mode 100644 index b881dfb..0000000 Binary files a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll and /dev/null differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll.meta b/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll.meta deleted file mode 100644 index b7fa11e..0000000 --- a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputDotNetPure.dll.meta +++ /dev/null @@ -1,145 +0,0 @@ -fileFormatVersion: 2 -guid: 049510a180c8082469b6f22cfd3521a4 -timeCreated: 1491640590 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - '': Any - second: - enabled: 0 - settings: - Exclude Android: 0 - Exclude Editor: 0 - Exclude Linux: 1 - Exclude Linux64: 1 - Exclude LinuxUniversal: 1 - Exclude OSXIntel: 1 - Exclude OSXIntel64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 0 - Exclude Win64: 1 - data: - first: - '': Editor - second: - enabled: 0 - settings: - CPU: x86 - OS: Windows - data: - first: - Android: Android - second: - enabled: 1 - settings: - CPU: ARMv7 - data: - first: - Any: - second: - enabled: 1 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 1 - settings: - CPU: x86 - DefaultValueInitialized: true - OS: Windows - data: - first: - Facebook: Win - second: - enabled: 1 - settings: - CPU: AnyCPU - data: - first: - Facebook: Win64 - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Linux - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: LinuxUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXIntel64 - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - data: - first: - Standalone: Win - second: - enabled: 1 - settings: - CPU: AnyCPU - data: - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - data: - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - data: - first: - iPhone: iOS - second: - enabled: 0 - settings: - CompileFlags: - FrameworkDependencies: - userData: - assetBundleName: - assetBundleVariant: diff --git a/XInputUnity4/XInputInterfaceX86.dll b/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll similarity index 95% rename from XInputUnity4/XInputInterfaceX86.dll rename to XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll index 6c50726..72d21be 100644 Binary files a/XInputUnity4/XInputInterfaceX86.dll and b/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll.meta b/XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll.meta similarity index 100% rename from XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterfaceX86.dll.meta rename to XInputUnity5/Assets/XInputDotNet/Plugins/x86/XInputInterface.dll.meta diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll b/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll deleted file mode 100644 index fb2634d..0000000 Binary files a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputDotNetPure.dll and /dev/null differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll b/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll similarity index 99% rename from XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll rename to XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll index c6fe75c..b9551df 100644 Binary files a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll and b/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll differ diff --git a/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll.meta b/XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll.meta similarity index 100% rename from XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterfaceX64.dll.meta rename to XInputUnity5/Assets/XInputDotNet/Plugins/x86_64/XInputInterface.dll.meta diff --git a/XInputUnity5/ProjectSettings/ProjectSettings.asset b/XInputUnity5/ProjectSettings/ProjectSettings.asset index c0819fa..1eec276 100644 Binary files a/XInputUnity5/ProjectSettings/ProjectSettings.asset and b/XInputUnity5/ProjectSettings/ProjectSettings.asset differ diff --git a/XInputUnity5/XInputUnity5.CSharp.csproj b/XInputUnity5/XInputUnity5.CSharp.csproj deleted file mode 100644 index 7baa1e4..0000000 --- a/XInputUnity5/XInputUnity5.CSharp.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {9AD8C088-E8BF-B562-387E-C687AB2886BF} - Library - Assembly-CSharp - 512 - {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - .NETFramework - v3.5 - Unity Subset v3.5 - - Game:1 - StandaloneWindows:5 - 5.6.0f3 - - 4 - - - pdbonly - false - Temp\UnityVS_bin\Debug\ - Temp\UnityVS_obj\Debug\ - prompt - 4 - DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_5_6_0;UNITY_5_6;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;ENABLE_VIDEO;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;ENABLE_VSTU - false - - - pdbonly - false - Temp\UnityVS_bin\Release\ - Temp\UnityVS_obj\Release\ - prompt - 4 - TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_5_6_0;UNITY_5_6;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_RUNTIME_NAVMESH_BUILDING;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;ENABLE_VIDEO;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_2_0_SUBSET;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;ENABLE_VSTU - false - - - - - - - - - - - - Library\UnityAssemblies\UnityEngine.dll - - - Library\UnityAssemblies\UnityEngine.UI.dll - - - Library\UnityAssemblies\UnityEngine.Networking.dll - - - Library\UnityAssemblies\UnityEngine.TestRunner.dll - - - Library\UnityAssemblies\nunit.framework.dll - - - Library\UnityAssemblies\UnityEngine.Analytics.dll - - - Library\UnityAssemblies\UnityEngine.HoloLens.dll - - - Library\UnityAssemblies\UnityEngine.VR.dll - - - Library\UnityAssemblies\UnityEditor.dll - - - Assets\XInputDotNet\Plugins\x86_64\XInputDotNetPure.dll - - - - - - - - - - -