├── .gitignore ├── Assets ├── Editor.meta ├── Editor │ ├── PackageExporter.cs │ ├── PackageExporter.cs.meta │ ├── VersionUpdater.cs │ └── VersionUpdater.cs.meta ├── InControl.meta └── InControl │ ├── Editor.meta │ ├── Editor │ ├── Images.meta │ ├── Images │ │ ├── InControlHeader.png │ │ └── InControlHeader.png.meta │ ├── InControlBuilder.cs │ ├── InControlBuilder.cs.meta │ ├── InControlManagerEditor.cs │ ├── InControlManagerEditor.cs.meta │ ├── InputManagerAssetGenerator.cs │ ├── InputManagerAssetGenerator.cs.meta │ ├── ProfileListGenerator.cs │ ├── ProfileListGenerator.cs.meta │ ├── ReorderableList.meta │ └── ReorderableList │ │ ├── GenericListAdaptor.cs │ │ ├── GenericListAdaptor.cs.meta │ │ ├── IReorderableListAdaptor.cs │ │ ├── IReorderableListAdaptor.cs.meta │ │ ├── Internal.meta │ │ ├── Internal │ │ ├── GUIHelper.cs │ │ ├── GUIHelper.cs.meta │ │ ├── ReorderableListResources.cs │ │ └── ReorderableListResources.cs.meta │ │ ├── ReorderableListControl.cs │ │ ├── ReorderableListControl.cs.meta │ │ ├── ReorderableListFlags.cs │ │ ├── ReorderableListFlags.cs.meta │ │ ├── ReorderableListGUI.cs │ │ ├── ReorderableListGUI.cs.meta │ │ ├── SerializedPropertyAdaptor.cs │ │ └── SerializedPropertyAdaptor.cs.meta │ ├── Examples.meta │ ├── Examples │ ├── Basic.meta │ ├── Basic │ │ ├── Basic.unity │ │ ├── Basic.unity.meta │ │ ├── CubeController.cs │ │ └── CubeController.cs.meta │ ├── CustomProfile.meta │ ├── CustomProfile │ │ ├── CubeController.cs │ │ ├── CubeController.cs.meta │ │ ├── CustomProfile.unity │ │ ├── CustomProfile.unity.meta │ │ ├── KeyboardAndMouseProfile.cs │ │ └── KeyboardAndMouseProfile.cs.meta │ ├── Gyro.meta │ ├── Gyro │ │ ├── CubeController.cs │ │ ├── CubeController.cs.meta │ │ ├── Gyro.unity │ │ ├── Gyro.unity.meta │ │ ├── GyroProfile.cs │ │ └── GyroProfile.cs.meta │ ├── InterfaceMovement.meta │ ├── InterfaceMovement │ │ ├── Button.cs │ │ ├── Button.cs.meta │ │ ├── ButtonFocus.cs │ │ ├── ButtonFocus.cs.meta │ │ ├── ButtonFocusMaterial.mat │ │ ├── ButtonFocusMaterial.mat.meta │ │ ├── ButtonManager.cs │ │ ├── ButtonManager.cs.meta │ │ ├── ButtonMaterial.mat │ │ ├── ButtonMaterial.mat.meta │ │ ├── InterfaceMovement.unity │ │ └── InterfaceMovement.unity.meta │ ├── Multiplayer.meta │ └── Multiplayer │ │ ├── CubeController.cs │ │ ├── CubeController.cs.meta │ │ ├── CubeMaterial.mat │ │ ├── CubeMaterial.mat.meta │ │ ├── Multiplayer.unity │ │ └── Multiplayer.unity.meta │ ├── README.meta │ ├── README │ ├── README.txt │ └── README.txt.meta │ ├── Source.meta │ ├── Source │ ├── Compatibility.meta │ ├── Compatibility │ │ ├── HeaderAttribute.cs │ │ ├── HeaderAttribute.cs.meta │ │ ├── RangeAttribute.cs │ │ ├── RangeAttribute.cs.meta │ │ ├── SpaceAttribute.cs │ │ └── SpaceAttribute.cs.meta │ ├── Components.meta │ ├── Components │ │ ├── InControlManager.cs │ │ └── InControlManager.cs.meta │ ├── Control.meta │ ├── Control │ │ ├── InputControl.cs │ │ ├── InputControl.cs.meta │ │ ├── InputControlMapping.cs │ │ ├── InputControlMapping.cs.meta │ │ ├── InputControlSource.cs │ │ ├── InputControlSource.cs.meta │ │ ├── InputControlState.cs │ │ ├── InputControlState.cs.meta │ │ ├── InputControlType.cs │ │ ├── InputControlType.cs.meta │ │ ├── OneAxisInputControl.cs │ │ ├── OneAxisInputControl.cs.meta │ │ ├── TwoAxisInputControl.cs │ │ └── TwoAxisInputControl.cs.meta │ ├── Debug.meta │ ├── Debug │ │ ├── Logger.cs │ │ └── Logger.cs.meta │ ├── Device.meta │ ├── Device │ │ ├── InputDevice.cs │ │ ├── InputDevice.cs.meta │ │ ├── InputDeviceManager.cs │ │ └── InputDeviceManager.cs.meta │ ├── InputManager.cs │ ├── InputManager.cs.meta │ ├── Unity.meta │ ├── Unity │ │ ├── ControlSources.meta │ │ ├── ControlSources │ │ │ ├── UnityAnalogSource.cs │ │ │ ├── UnityAnalogSource.cs.meta │ │ │ ├── UnityButtonSource.cs │ │ │ ├── UnityButtonSource.cs.meta │ │ │ ├── UnityGyroAxisSource.cs │ │ │ ├── UnityGyroAxisSource.cs.meta │ │ │ ├── UnityKeyCodeAxisSource.cs │ │ │ ├── UnityKeyCodeAxisSource.cs.meta │ │ │ ├── UnityKeyCodeComboSource.cs │ │ │ ├── UnityKeyCodeComboSource.cs.meta │ │ │ ├── UnityKeyCodeSource.cs │ │ │ ├── UnityKeyCodeSource.cs.meta │ │ │ ├── UnityMouseAxisSource.cs │ │ │ ├── UnityMouseAxisSource.cs.meta │ │ │ ├── UnityMouseButtonSource.cs │ │ │ └── UnityMouseButtonSource.cs.meta │ │ ├── DeviceProfiles.meta │ │ ├── DeviceProfiles │ │ │ ├── AmazonFireTVProfile.cs │ │ │ ├── AmazonFireTVProfile.cs.meta │ │ │ ├── AmazonFireTVRemoteProfile.cs │ │ │ ├── AmazonFireTVRemoteProfile.cs.meta │ │ │ ├── AndroidTVProfile.cs │ │ │ ├── AndroidTVProfile.cs.meta │ │ │ ├── AndroidTVRemoteProfile.cs │ │ │ ├── AndroidTVRemoteProfile.cs.meta │ │ │ ├── AppleMFiProfile.cs │ │ │ ├── AppleMFiProfile.cs.meta │ │ │ ├── ExecutionerXProfile.cs │ │ │ ├── ExecutionerXProfile.cs.meta │ │ │ ├── GameStickLinuxProfile.cs │ │ │ ├── GameStickLinuxProfile.cs.meta │ │ │ ├── GameStickProfile.cs │ │ │ ├── GameStickProfile.cs.meta │ │ │ ├── GenericAndroidProfile.cs │ │ │ ├── GenericAndroidProfile.cs.meta │ │ │ ├── GenericBlackberryProfile.cs │ │ │ ├── GenericBlackberryProfile.cs.meta │ │ │ ├── GenericLinuxProfile.cs │ │ │ ├── GenericLinuxProfile.cs.meta │ │ │ ├── GoogleNexusPlayerProfile.cs │ │ │ ├── GoogleNexusPlayerProfile.cs.meta │ │ │ ├── GoogleNexusPlayerRemoteProfile.cs │ │ │ ├── GoogleNexusPlayerRemoteProfile.cs.meta │ │ │ ├── GreenThrottleAtlasAndroidProfile.cs │ │ │ ├── GreenThrottleAtlasAndroidProfile.cs.meta │ │ │ ├── HamaBlackForceWinProfile.cs │ │ │ ├── HamaBlackForceWinProfile.cs.meta │ │ │ ├── LogitechF310LinuxProfile.cs │ │ │ ├── LogitechF310LinuxProfile.cs.meta │ │ │ ├── LogitechF310ModeDMacProfile.cs │ │ │ ├── LogitechF310ModeDMacProfile.cs.meta │ │ │ ├── LogitechF310ModeDWinProfile.cs │ │ │ ├── LogitechF310ModeDWinProfile.cs.meta │ │ │ ├── LogitechF310ModeXMacProfile.cs │ │ │ ├── LogitechF310ModeXMacProfile.cs.meta │ │ │ ├── LogitechF310ModeXWinProfile.cs │ │ │ ├── LogitechF310ModeXWinProfile.cs.meta │ │ │ ├── LogitechF510LinuxProfile.cs │ │ │ ├── LogitechF510LinuxProfile.cs.meta │ │ │ ├── LogitechF510WinProfile.cs │ │ │ ├── LogitechF510WinProfile.cs.meta │ │ │ ├── LogitechF710LinuxProfile.cs │ │ │ ├── LogitechF710LinuxProfile.cs.meta │ │ │ ├── LogitechF710MacProfile.cs │ │ │ ├── LogitechF710MacProfile.cs.meta │ │ │ ├── LogitechF710ModeDWinProfile.cs │ │ │ ├── LogitechF710ModeDWinProfile.cs.meta │ │ │ ├── LogitechF710ModeXWinProfile.cs │ │ │ ├── LogitechF710ModeXWinProfile.cs.meta │ │ │ ├── LogitechRumblePad2MacProfile.cs │ │ │ ├── LogitechRumblePad2MacProfile.cs.meta │ │ │ ├── LogitechRumblePad2WinProfile.cs │ │ │ ├── LogitechRumblePad2WinProfile.cs.meta │ │ │ ├── LogitechWingManWinProfile.cs │ │ │ ├── LogitechWingManWinProfile.cs.meta │ │ │ ├── MaxFireBlaze5WinProfile.cs │ │ │ ├── MaxFireBlaze5WinProfile.cs.meta │ │ │ ├── MogaProLinuxProfile.cs │ │ │ ├── MogaProLinuxProfile.cs.meta │ │ │ ├── MogaProMacProfile.cs │ │ │ ├── MogaProMacProfile.cs.meta │ │ │ ├── MogaProWinProfile.cs │ │ │ ├── MogaProWinProfile.cs.meta │ │ │ ├── NVidiaShieldAndroidProfile.cs │ │ │ ├── NVidiaShieldAndroidProfile.cs.meta │ │ │ ├── NVidiaShieldWinProfile.cs │ │ │ ├── NVidiaShieldWinProfile.cs.meta │ │ │ ├── NatecGenesisP44WinProfile.cs │ │ │ ├── NatecGenesisP44WinProfile.cs.meta │ │ │ ├── OuyaLinuxProfile.cs │ │ │ ├── OuyaLinuxProfile.cs.meta │ │ │ ├── OuyaWinProfile.cs │ │ │ ├── OuyaWinProfile.cs.meta │ │ │ ├── PlayStation2WinProfile.cs │ │ │ ├── PlayStation2WinProfile.cs.meta │ │ │ ├── PlayStation3AndroidProfile.cs │ │ │ ├── PlayStation3AndroidProfile.cs.meta │ │ │ ├── PlayStation3LinuxProfile.cs │ │ │ ├── PlayStation3LinuxProfile.cs.meta │ │ │ ├── PlayStation3MacProfile.cs │ │ │ ├── PlayStation3MacProfile.cs.meta │ │ │ ├── PlayStation3ShenghicWinProfile.cs │ │ │ ├── PlayStation3ShenghicWinProfile.cs.meta │ │ │ ├── PlayStation3WinProfile.cs │ │ │ ├── PlayStation3WinProfile.cs.meta │ │ │ ├── PlayStation4AndroidProfile.cs │ │ │ ├── PlayStation4AndroidProfile.cs.meta │ │ │ ├── PlayStation4LinuxProfile.cs │ │ │ ├── PlayStation4LinuxProfile.cs.meta │ │ │ ├── PlayStation4MacBTProfile.cs │ │ │ ├── PlayStation4MacBTProfile.cs.meta │ │ │ ├── PlayStation4MacUSBProfile.cs │ │ │ ├── PlayStation4MacUSBProfile.cs.meta │ │ │ ├── PlayStation4Profile.cs │ │ │ ├── PlayStation4Profile.cs.meta │ │ │ ├── PlayStation4WinProfile.cs │ │ │ ├── PlayStation4WinProfile.cs.meta │ │ │ ├── PlayStationVitaPSMProfile.cs │ │ │ ├── PlayStationVitaPSMProfile.cs.meta │ │ │ ├── SamsungGP20AndroidProfile.cs │ │ │ ├── SamsungGP20AndroidProfile.cs.meta │ │ │ ├── SpeedlinkStrikeMacProfile.cs │ │ │ ├── SpeedlinkStrikeMacProfile.cs.meta │ │ │ ├── SpeedlinkStrikeWinProfile.cs │ │ │ ├── SpeedlinkStrikeWinProfile.cs.meta │ │ │ ├── SteelSeriesFreeLinuxProfile.cs │ │ │ ├── SteelSeriesFreeLinuxProfile.cs.meta │ │ │ ├── SteelSeriesFreeMacProfile.cs │ │ │ ├── SteelSeriesFreeMacProfile.cs.meta │ │ │ ├── SteelSeriesFreeWinProfile.cs │ │ │ ├── SteelSeriesFreeWinProfile.cs.meta │ │ │ ├── ValveStreamingWinProfile.cs │ │ │ ├── ValveStreamingWinProfile.cs.meta │ │ │ ├── Xbox360AndroidProfile.cs │ │ │ ├── Xbox360AndroidProfile.cs.meta │ │ │ ├── Xbox360LinuxProfile.cs │ │ │ ├── Xbox360LinuxProfile.cs.meta │ │ │ ├── Xbox360MacProfile.cs │ │ │ ├── Xbox360MacProfile.cs.meta │ │ │ ├── Xbox360WinProfile.cs │ │ │ ├── Xbox360WinProfile.cs.meta │ │ │ ├── XboxOneMacProfile.cs │ │ │ ├── XboxOneMacProfile.cs.meta │ │ │ ├── XboxOneProfile.cs │ │ │ ├── XboxOneProfile.cs.meta │ │ │ ├── XboxOneWinProfile.cs │ │ │ └── XboxOneWinProfile.cs.meta │ │ ├── UnityInputDevice.cs │ │ ├── UnityInputDevice.cs.meta │ │ ├── UnityInputDeviceManager.cs │ │ ├── UnityInputDeviceManager.cs.meta │ │ ├── UnityInputDeviceProfile.cs │ │ ├── UnityInputDeviceProfile.cs.meta │ │ ├── UnityInputDeviceProfileList.cs │ │ ├── UnityInputDeviceProfileList.cs.meta │ │ ├── UnityUnknownDeviceProfile.cs │ │ └── UnityUnknownDeviceProfile.cs.meta │ ├── Utility.meta │ ├── Utility │ │ ├── SingletonMonoBehavior.cs │ │ ├── SingletonMonoBehavior.cs.meta │ │ ├── Utility.cs │ │ └── Utility.cs.meta │ ├── VersionInfo.cs │ ├── VersionInfo.cs.meta │ ├── XInput.meta │ └── XInput │ │ ├── XInputDevice.cs │ │ ├── XInputDevice.cs.meta │ │ ├── XInputDeviceManager.cs │ │ ├── XInputDeviceManager.cs.meta │ │ ├── XInputDotNetPure.meta │ │ ├── XInputDotNetPure │ │ ├── GamePad.cs │ │ ├── GamePad.cs.meta │ │ ├── Utils.cs │ │ └── Utils.cs.meta │ │ ├── XInputInterface.dll │ │ └── XInputInterface.dll.meta │ ├── Test.meta │ └── Test │ ├── Roboto-Regular.ttf │ ├── Roboto-Regular.ttf.meta │ ├── TestInputManager.cs │ ├── TestInputManager.cs.meta │ ├── TestInputManager.unity │ └── TestInputManager.unity.meta ├── CHANGELOG ├── Images ├── Controller.ai ├── Controller.png ├── Logos.ai ├── LogosOld.ai ├── Logos_Logo1.png ├── Logos_Logo2.png ├── Logos_Logo3.png ├── ScreenShot1.png ├── ScreenShot2.png ├── ScreenShot3.png ├── ScreenShot4.png └── ScreenShot5.png ├── InControl.sublime-project ├── InControl.sublime-workspace ├── Packages └── .gitkeep ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset ├── README.markdown ├── XInputInterface.dll ├── changed.sh └── doxygen.conf /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /Build/* 5 | /*.csproj 6 | /*.unityproj 7 | /*.sln 8 | /*.suo 9 | /*.user 10 | /*.userprefs 11 | /*.pidb 12 | /*.booproj 13 | .DS_Store 14 | Thumbs.db 15 | /Assets/AssetStoreTools/ 16 | /Assets/AssetStoreTools.meta 17 | /Documentation/ 18 | /.dropbox.attr 19 | /Dev References 20 | /Packages/*.unitypackage 21 | /Assets/WorkInProgress 22 | /Assets/WorkInProgress.meta 23 | /Assets/InControl/Examples/TouchControls 24 | /Assets/InControl/Examples/TouchControls.meta 25 | /Assets/InControl/Source/Touch 26 | /Assets/InControl/Source/Touch.meta 27 | /Assets/InControl/Source/OuyaEverywhere 28 | /Assets/InControl/Source/OuyaEverywhere.meta 29 | /Assets/InControl/Source/GUI 30 | /Assets/InControl/Source/GUI.meta 31 | /Assets/UnityTestTools 32 | /Assets/UnityTestTools.meta 33 | Ouya -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 672e68e083b884d8eb66e35f52b797ec 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Editor/PackageExporter.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System; 3 | using UnityEditor; 4 | using InControl; 5 | 6 | 7 | namespace InControl 8 | { 9 | public class PackageExporter 10 | { 11 | [MenuItem("Assets/InControl/Generate Unity Package")] 12 | static void CreateUnityPackage() 13 | { 14 | var assetPathNames = new string[] { 15 | "Assets/InControl" 16 | }; 17 | var packageName = "Packages/InControl-" + VersionInfo.InControlVersion().ToShortString() + ".unitypackage"; 18 | AssetDatabase.ExportPackage( assetPathNames, packageName, ExportPackageOptions.Recurse ); 19 | } 20 | } 21 | } 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /Assets/Editor/PackageExporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a84182b7156a54686bf29c9f041786fd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/VersionUpdater.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.IO; 3 | using System.Text.RegularExpressions; 4 | using UnityEditor; 5 | using UnityEngine; 6 | 7 | 8 | namespace InControl 9 | { 10 | [InitializeOnLoad] 11 | public class VersionUpdater 12 | { 13 | static VersionUpdater() 14 | { 15 | EditorApplication.playmodeStateChanged += Update; 16 | } 17 | 18 | 19 | static void Update() 20 | { 21 | if (!EditorApplication.isPlaying) 22 | { 23 | EditorApplication.playmodeStateChanged -= Update; 24 | UpdateVersion(); 25 | } 26 | } 27 | 28 | 29 | static void UpdateVersion() 30 | { 31 | string versionPath = "Assets/InControl/Source/VersionInfo.cs"; 32 | string versionText = GetFileContents( versionPath ); 33 | if (versionText != null) 34 | { 35 | versionText = Regex.Replace( versionText, @"Build = (?\d+)", ReplaceFunc ); 36 | PutFileContents( versionPath, versionText ); 37 | AssetDatabase.Refresh(); 38 | } 39 | } 40 | 41 | 42 | static string ReplaceFunc( Match match ) 43 | { 44 | var value = int.Parse( match.Groups["value"].Value ) + 1; 45 | return "Build = " + value.ToString(); 46 | } 47 | 48 | 49 | static string GetFileContents( string fileName ) 50 | { 51 | StreamReader streamReader = new StreamReader( fileName ); 52 | var fileContents = streamReader.ReadToEnd(); 53 | streamReader.Close(); 54 | 55 | return fileContents; 56 | } 57 | 58 | 59 | static void PutFileContents( string filePath, string content ) 60 | { 61 | StreamWriter streamWriter = new StreamWriter( filePath ); 62 | streamWriter.Write( content.Trim() ); 63 | streamWriter.Flush(); 64 | streamWriter.Close(); 65 | } 66 | } 67 | } 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /Assets/Editor/VersionUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eee41817119b47598d137d233a2cd8e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9af6d6599b7f476fa468f6f65bd93f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33cb3bae592504ca081879123d2cf188 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/Images.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 22f47f9a2cb61484389d41ae5bab8256 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/Images/InControlHeader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Editor/Images/InControlHeader.png -------------------------------------------------------------------------------- /Assets/InControl/Editor/Images/InControlHeader.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3831725eee5d3449b9f21bdbf75938bd 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -3 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: -1 27 | aniso: -1 28 | mipBias: -1 29 | wrapMode: -1 30 | nPOTScale: 1 31 | lightmap: 0 32 | compressionQuality: 50 33 | spriteMode: 0 34 | spriteExtrude: 1 35 | spriteMeshType: 1 36 | alignment: 0 37 | spritePivot: {x: .5, y: .5} 38 | spritePixelsToUnits: 100 39 | alphaIsTransparency: 0 40 | textureType: -1 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/InControlBuilder.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using System.Collections.Generic; 6 | 7 | 8 | namespace InControl 9 | { 10 | internal class InControlBuilder 11 | { 12 | [MenuItem("GameObject/Create Other/InControl/Manager", false, 1)] 13 | static void CreateInputManager() 14 | { 15 | MonoBehaviour component; 16 | if (component = GameObject.FindObjectOfType()) 17 | { 18 | Selection.activeGameObject = component.gameObject; 19 | 20 | Debug.LogError( "InControlManager component is already attached to selected object." ); 21 | return; 22 | } 23 | 24 | GameObject gameObject = GameObject.Find( "InControl" ) ?? new GameObject( "InControl" ); 25 | gameObject.AddComponent(); 26 | Selection.activeGameObject = gameObject; 27 | 28 | Debug.Log( "InControl manager object has been created." ); 29 | } 30 | } 31 | } 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/InControlBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5cfd9f41ede60450498aefbb913dbdec 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/InControlManagerEditor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System.IO; 3 | using UnityEditor; 4 | using UnityEngine; 5 | using InControl.ReorderableList; 6 | 7 | 8 | namespace InControl 9 | { 10 | [CustomEditor( typeof(InControlManager) )] 11 | public class InControlManagerEditor : Editor 12 | { 13 | SerializedProperty logDebugInfo; 14 | SerializedProperty invertYAxis; 15 | SerializedProperty enableXInput; 16 | SerializedProperty useFixedUpdate; 17 | SerializedProperty dontDestroyOnLoad; 18 | SerializedProperty customProfiles; 19 | Texture headerTexture; 20 | 21 | 22 | void OnEnable() 23 | { 24 | logDebugInfo = serializedObject.FindProperty( "logDebugInfo" ); 25 | invertYAxis = serializedObject.FindProperty( "invertYAxis" ); 26 | enableXInput = serializedObject.FindProperty( "enableXInput" ); 27 | useFixedUpdate = serializedObject.FindProperty( "useFixedUpdate" ); 28 | dontDestroyOnLoad = serializedObject.FindProperty( "dontDestroyOnLoad" ); 29 | customProfiles = serializedObject.FindProperty( "customProfiles" ); 30 | 31 | var path = AssetDatabase.GetAssetPath( MonoScript.FromScriptableObject( this ) ); 32 | headerTexture = Resources.LoadAssetAtPath( Path.GetDirectoryName( path ) + "/Images/InControlHeader.png" ); 33 | } 34 | 35 | 36 | public override void OnInspectorGUI() 37 | { 38 | serializedObject.Update(); 39 | 40 | GUILayout.Space( 5.0f ); 41 | 42 | var headerRect = GUILayoutUtility.GetRect( 0.0f, 5.0f ); 43 | headerRect.width = headerTexture.width; 44 | headerRect.height = headerTexture.height; 45 | GUILayout.Space( headerRect.height ); 46 | GUI.DrawTexture( headerRect, headerTexture ); 47 | 48 | logDebugInfo.boolValue = EditorGUILayout.ToggleLeft( "Log Debug Info", logDebugInfo.boolValue ); 49 | invertYAxis.boolValue = EditorGUILayout.ToggleLeft( "Invert Y Axis", invertYAxis.boolValue ); 50 | enableXInput.boolValue = EditorGUILayout.ToggleLeft( "Enable XInput (Windows)", enableXInput.boolValue ); 51 | useFixedUpdate.boolValue = EditorGUILayout.ToggleLeft( "Use Fixed Update", useFixedUpdate.boolValue ); 52 | dontDestroyOnLoad.boolValue = EditorGUILayout.ToggleLeft( "Don't Destroy On Load", dontDestroyOnLoad.boolValue ); 53 | 54 | ReorderableListGUI.Title( "Custom Profiles" ); 55 | ReorderableListGUI.ListField( customProfiles ); 56 | 57 | GUILayout.Space( 3.0f ); 58 | 59 | serializedObject.ApplyModifiedProperties(); 60 | } 61 | } 62 | } 63 | #endif -------------------------------------------------------------------------------- /Assets/InControl/Editor/InControlManagerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e795c374f5d3748a78ab7d2457d47089 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/InputManagerAssetGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 715148ddd826c47a08e6e5f3abf458c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ProfileListGenerator.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Text.RegularExpressions; 6 | using UnityEditor; 7 | using UnityEngine; 8 | 9 | 10 | namespace InControl 11 | { 12 | [InitializeOnLoad] 13 | internal class ProfileListGenerator 14 | { 15 | static ProfileListGenerator() 16 | { 17 | DiscoverProfiles(); 18 | } 19 | 20 | 21 | static void DiscoverProfiles() 22 | { 23 | var unityInputDeviceProfileType = typeof(InControl.UnityInputDeviceProfile); 24 | var autoDiscoverAttributeType = typeof(InControl.AutoDiscover); 25 | 26 | var code2 = ""; 27 | foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) 28 | { 29 | foreach (var type in assembly.GetTypes()) 30 | { 31 | if (type.IsSubclassOf( unityInputDeviceProfileType )) 32 | { 33 | var typeAttrs = type.GetCustomAttributes( autoDiscoverAttributeType, false ); 34 | if (typeAttrs != null && typeAttrs.Length > 0) 35 | { 36 | code2 += "\t\t\t\"" + type.FullName + "\"," + Environment.NewLine; 37 | } 38 | } 39 | } 40 | } 41 | 42 | var instance = ScriptableObject.CreateInstance(); 43 | var filePath = AssetDatabase.GetAssetPath( MonoScript.FromScriptableObject( instance ) ); 44 | ScriptableObject.DestroyImmediate( instance ); 45 | 46 | string code1 = @"using System; 47 | using UnityEngine; 48 | 49 | 50 | namespace InControl 51 | { 52 | public class UnityInputDeviceProfileList : ScriptableObject 53 | { 54 | public static string[] Profiles = new string[] 55 | { 56 | "; 57 | 58 | string code3 = @" }; 59 | } 60 | }"; 61 | 62 | var code = FixNewLines( code1 + code2 + code3 ); 63 | if (PutFileContents( filePath, code )) 64 | { 65 | Debug.Log( "InControl has updated the autodiscover profiles list." ); 66 | } 67 | } 68 | 69 | 70 | static string GetFileContents( string fileName ) 71 | { 72 | StreamReader streamReader = new StreamReader( fileName ); 73 | var fileContents = streamReader.ReadToEnd(); 74 | streamReader.Close(); 75 | 76 | return fileContents; 77 | } 78 | 79 | 80 | static bool PutFileContents( string filePath, string content ) 81 | { 82 | var oldContent = GetFileContents( filePath ); 83 | if (CompareIgnoringWhitespace( content, oldContent )) 84 | { 85 | return false; 86 | } 87 | 88 | StreamWriter streamWriter = new StreamWriter( filePath ); 89 | streamWriter.Write( content ); 90 | streamWriter.Flush(); 91 | streamWriter.Close(); 92 | 93 | return true; 94 | } 95 | 96 | 97 | static string FixNewLines( string text ) 98 | { 99 | return Regex.Replace( text, @"\r\n|\n", Environment.NewLine ); 100 | } 101 | 102 | 103 | static bool CompareIgnoringWhitespace( string s1, string s2 ) 104 | { 105 | return Regex.Replace( s1, @"\s", "" ) == Regex.Replace( s2, @"\s", "" ); 106 | } 107 | } 108 | } 109 | #endif 110 | 111 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ProfileListGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8414cf20bfe8445fbb0689c0e94ab18a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df770105fd7d24d02ae3df40bad90ece 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/GenericListAdaptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | using UnityEngine; 6 | 7 | using System.Collections.Generic; 8 | 9 | namespace InControl.ReorderableList 10 | { 11 | 12 | /// 13 | /// Reorderable list adaptor for generic list. 14 | /// 15 | /// 16 | /// This adaptor can be subclassed to add special logic to item height calculation. 17 | /// You may want to implement a custom adaptor class where specialised functionality 18 | /// is needed. 19 | /// 20 | /// Type of list element. 21 | public class GenericListAdaptor : IReorderableListAdaptor 22 | { 23 | 24 | private IList _list; 25 | 26 | private ReorderableListControl.ItemDrawer _itemDrawer; 27 | 28 | /// 29 | /// Fixed height of each list item. 30 | /// 31 | public float fixedItemHeight; 32 | 33 | /// 34 | /// Gets the underlying list data structure. 35 | /// 36 | public IList List 37 | { 38 | get { return _list; } 39 | } 40 | 41 | /// 42 | /// Gets element from list. 43 | /// 44 | /// Zero-based index of element. 45 | /// 46 | /// The element. 47 | /// 48 | public T this[ int index ] 49 | { 50 | get { return _list[index]; } 51 | } 52 | 53 | #region Construction 54 | 55 | /// 56 | /// Initializes a new instance of . 57 | /// 58 | /// The list which can be reordered. 59 | /// Callback to draw list item. 60 | /// Height of list item in pixels. 61 | public GenericListAdaptor( IList list, ReorderableListControl.ItemDrawer itemDrawer, float itemHeight ) 62 | { 63 | this._list = list; 64 | this._itemDrawer = itemDrawer ?? ReorderableListGUI.DefaultItemDrawer; 65 | this.fixedItemHeight = itemHeight; 66 | } 67 | 68 | #endregion 69 | 70 | #region IReorderableListAdaptor - Implementation 71 | 72 | /// 73 | public int Count 74 | { 75 | get { return _list.Count; } 76 | } 77 | 78 | /// 79 | public virtual bool CanDrag( int index ) 80 | { 81 | return true; 82 | } 83 | /// 84 | public virtual bool CanRemove( int index ) 85 | { 86 | return true; 87 | } 88 | 89 | /// 90 | public void Add() 91 | { 92 | _list.Add( default(T) ); 93 | } 94 | /// 95 | public void Insert( int index ) 96 | { 97 | _list.Insert( index, default(T) ); 98 | } 99 | /// 100 | public void Duplicate( int index ) 101 | { 102 | _list.Insert( index + 1, _list[index] ); 103 | } 104 | /// 105 | public void Remove( int index ) 106 | { 107 | _list.RemoveAt( index ); 108 | } 109 | /// 110 | public void Move( int sourceIndex, int destIndex ) 111 | { 112 | if (destIndex > sourceIndex) 113 | --destIndex; 114 | 115 | T item = _list[sourceIndex]; 116 | _list.RemoveAt( sourceIndex ); 117 | _list.Insert( destIndex, item ); 118 | } 119 | /// 120 | public void Clear() 121 | { 122 | _list.Clear(); 123 | } 124 | 125 | /// 126 | public virtual void DrawItem( Rect position, int index ) 127 | { 128 | _list[index] = _itemDrawer( position, _list[index] ); 129 | } 130 | 131 | /// 132 | public virtual float GetItemHeight( int index ) 133 | { 134 | return fixedItemHeight; 135 | } 136 | 137 | #endregion 138 | 139 | } 140 | 141 | } -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/GenericListAdaptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f0d672aa539a4371ad43e2c6ecd87c2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/IReorderableListAdaptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | using UnityEngine; 6 | 7 | namespace InControl.ReorderableList 8 | { 9 | 10 | /// 11 | /// Adaptor allowing reorderable list control to interface with list data. 12 | /// 13 | public interface IReorderableListAdaptor 14 | { 15 | 16 | /// 17 | /// Gets count of elements in list. 18 | /// 19 | int Count { get; } 20 | 21 | /// 22 | /// Determines whether an item can be reordered by dragging mouse. 23 | /// 24 | /// 25 | /// This should be a light-weight method since it will be used to determine 26 | /// whether grab handle should be included for each item in a reorderable list. 27 | /// Please note that returning a value of false does not prevent movement 28 | /// on list item since other draggable items can be moved around it. 29 | /// 30 | /// Zero-based index for list element. 31 | /// 32 | /// A value of true if item can be dragged; otherwise false. 33 | /// 34 | bool CanDrag( int index ); 35 | /// 36 | /// Determines whether an item can be removed from list. 37 | /// 38 | /// 39 | /// This should be a light-weight method since it will be used to determine 40 | /// whether remove button should be included for each item in list. 41 | /// This is redundant when 42 | /// is specified. 43 | /// 44 | /// Zero-based index for list element. 45 | /// 46 | /// A value of true if item can be removed; otherwise false. 47 | /// 48 | bool CanRemove( int index ); 49 | 50 | /// 51 | /// Add new element at end of list. 52 | /// 53 | void Add(); 54 | /// 55 | /// Insert new element at specified index. 56 | /// 57 | /// Zero-based index for list element. 58 | void Insert( int index ); 59 | /// 60 | /// Duplicate existing element. 61 | /// 62 | /// Zero-based index of list element. 63 | void Duplicate( int index ); 64 | /// 65 | /// Remove element at specified index. 66 | /// 67 | /// Zero-based index of list element. 68 | void Remove( int index ); 69 | /// 70 | /// Move element from source index to destination index. 71 | /// 72 | /// Zero-based index of source element. 73 | /// Zero-based index of destination element. 74 | void Move( int sourceIndex, int destIndex ); 75 | /// 76 | /// Clear all elements from list. 77 | /// 78 | void Clear(); 79 | 80 | /// 81 | /// Draw interface for list element. 82 | /// 83 | /// Position in GUI. 84 | /// Zero-based index of array element. 85 | void DrawItem( Rect position, int index ); 86 | /// 87 | /// Gets height of list item in pixels. 88 | /// 89 | /// Zero-based index of array element. 90 | /// 91 | /// Measurement in pixels. 92 | /// 93 | float GetItemHeight( int index ); 94 | 95 | } 96 | 97 | } -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/IReorderableListAdaptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52bf7b2b1c31b459896c69f347ec3479 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89a903389fa1447ea9f2c98197725e6a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/Internal/GUIHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | using UnityEngine; 6 | using UnityEditor; 7 | 8 | using System; 9 | using System.Reflection; 10 | 11 | namespace InControl.ReorderableList.Internal 12 | { 13 | 14 | /// 15 | /// Utility functions to assist with GUIs. 16 | /// 17 | internal static class GUIHelper 18 | { 19 | 20 | static GUIHelper() 21 | { 22 | var tyGUIClip = typeof(GUI).Assembly.GetType( "UnityEngine.GUIClip" ); 23 | if (tyGUIClip != null) 24 | { 25 | var piVisibleRect = tyGUIClip.GetProperty( "visibleRect", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); 26 | if (piVisibleRect != null) 27 | { 28 | var getMethod = piVisibleRect.GetGetMethod(true) ?? piVisibleRect.GetGetMethod(false); 29 | VisibleRect = (Func)Delegate.CreateDelegate(typeof(Func), getMethod); 30 | } 31 | } 32 | 33 | var miFocusTextInControl = typeof(EditorGUI).GetMethod( "FocusTextInControl", BindingFlags.Static | BindingFlags.Public ); 34 | if (miFocusTextInControl == null) 35 | miFocusTextInControl = typeof(GUI).GetMethod( "FocusControl", BindingFlags.Static | BindingFlags.Public ); 36 | 37 | FocusTextInControl = (Action)Delegate.CreateDelegate( typeof(Action), miFocusTextInControl ); 38 | } 39 | 40 | /// 41 | /// Gets visible rectangle within GUI. 42 | /// 43 | /// 44 | /// VisibleRect = TopmostRect + scrollViewOffsets 45 | /// 46 | public static Func VisibleRect; 47 | 48 | /// 49 | /// Focus control and text editor where applicable. 50 | /// 51 | public static Action FocusTextInControl; 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/Internal/GUIHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 773910b00b8de49dd8ac0192e11e3227 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/Internal/ReorderableListResources.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3b30bdfa18154060bb6945bed65d8eb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/ReorderableListControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7449d5ee58dc949ae9e48df297608904 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/ReorderableListFlags.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | using System; 6 | 7 | namespace InControl.ReorderableList 8 | { 9 | 10 | /// 11 | /// Additional flags which can be passed into reorderable list field. 12 | /// 13 | /// 14 | /// Multiple flags can be specified if desired: 15 | /// 19 | /// 20 | [Flags] 21 | public enum ReorderableListFlags 22 | { 23 | /// 24 | /// Hide grab handles and disable reordering of list items. 25 | /// 26 | DisableReordering = 0x01, 27 | /// 28 | /// Hide add button at base of control. 29 | /// 30 | HideAddButton = 0x02, 31 | /// 32 | /// Hide remove buttons from list items. 33 | /// 34 | HideRemoveButtons = 0x04, 35 | /// 36 | /// Do not display context menu upon right-clicking grab handle. 37 | /// 38 | DisableContextMenu = 0x08, 39 | /// 40 | /// Hide "Duplicate" option from context menu. 41 | /// 42 | DisableDuplicateCommand = 0x10, 43 | /// 44 | /// Do not automatically focus first control of newly added items. 45 | /// 46 | DisableAutoFocus = 0x20, 47 | /// 48 | /// Show zero-based index of array elements. 49 | /// 50 | ShowIndices = 0x40, 51 | /// 52 | /// Do not attempt to clip items which are out of view. 53 | /// 54 | /// 55 | /// Clipping helps to boost performance, though may lead to issues on 56 | /// some interfaces. 57 | /// 58 | DisableClipping = 0x80, 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/ReorderableListFlags.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d78a12eba9cd148d9a5d02acc6bf2e62 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/ReorderableListGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62c907a173e8e4c739cf8dd36cdf2621 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Editor/ReorderableList/SerializedPropertyAdaptor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97e2cf2107a0b436cad75d75f8906fb6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c7bfe76a6203457998daba089125e3a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Basic.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a6e4c7ed5c0e4622b6dc3b6daa6131b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Basic/Basic.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/Basic/Basic.unity -------------------------------------------------------------------------------- /Assets/InControl/Examples/Basic/Basic.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4477a0d9a0ef428dbc5f38c0cb72d45 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Basic/CubeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using InControl; 4 | 5 | 6 | namespace BasicExample 7 | { 8 | public class CubeController : MonoBehaviour 9 | { 10 | void Update() 11 | { 12 | // Use last device which provided input. 13 | var inputDevice = InputManager.ActiveDevice; 14 | 15 | // Rotate target object with left stick. 16 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.LeftStickX, Space.World ); 17 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.LeftStickY, Space.World ); 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Basic/CubeController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 296f99bbf2f22493c927979200a98465 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ebbd0bac43204f998b42ec51a408b02 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/CubeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using InControl; 4 | 5 | 6 | namespace CustomProfileExample 7 | { 8 | public class CubeController : MonoBehaviour 9 | { 10 | Vector3 targetPosition; 11 | Renderer cubeRenderer; 12 | 13 | 14 | void Start() 15 | { 16 | cubeRenderer = GetComponent(); 17 | 18 | // Get the starting position of the object. 19 | targetPosition = transform.position; 20 | } 21 | 22 | 23 | void Update() 24 | { 25 | // Use last device which provided input. 26 | var inputDevice = InputManager.ActiveDevice; 27 | 28 | // Set target object material color based on which action is pressed. 29 | cubeRenderer.material.color = GetColorFromActionButtons( inputDevice ); 30 | 31 | // Rotate target object with both sticks and d-pad. 32 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.Direction.X, Space.World ); 33 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.Direction.Y, Space.World ); 34 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.RightStickX, Space.World ); 35 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.RightStickY, Space.World ); 36 | 37 | // Zoom target object with scroll wheel. 38 | var z = inputDevice.GetControl( InputControlType.ScrollWheel ); 39 | targetPosition.z = Mathf.Clamp( targetPosition.z + z, -10.0f, 25.0f ); 40 | transform.position = Vector3.MoveTowards( transform.position, targetPosition, Time.deltaTime * 25.0f ); 41 | 42 | // Only supported on Windows with XInput and Xbox 360 controllers. 43 | InputManager.ActiveDevice.Vibrate( inputDevice.LeftTrigger, inputDevice.RightTrigger ); 44 | } 45 | 46 | 47 | Color GetColorFromActionButtons( InputDevice inputDevice ) 48 | { 49 | if (inputDevice.Action1) 50 | { 51 | return Color.green; 52 | } 53 | 54 | if (inputDevice.Action2) 55 | { 56 | return Color.red; 57 | } 58 | 59 | if (inputDevice.Action3) 60 | { 61 | return Color.blue; 62 | } 63 | 64 | if (inputDevice.Action4) 65 | { 66 | return Color.yellow; 67 | } 68 | 69 | // Test for a combo keypress, mapped to left bumper. 70 | if (inputDevice.LeftBumper) 71 | { 72 | return Color.magenta; 73 | } 74 | 75 | 76 | return Color.white; 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/CubeController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 434f81974ae9b4703923168b5ecd31d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/CustomProfile.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/CustomProfile/CustomProfile.unity -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/CustomProfile.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85cede67854184d7ba926531da8c77e3 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/KeyboardAndMouseProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using InControl; 5 | 6 | 7 | namespace CustomProfileExample 8 | { 9 | // This custom profile is enabled by adding it to the Custom Profiles list 10 | // on the InControlManager component, or you can attach it yourself like so: 11 | // InputManager.AttachDevice( new UnityInputDevice( "KeyboardAndMouseProfile" ) ); 12 | // 13 | public class KeyboardAndMouseProfile : UnityInputDeviceProfile 14 | { 15 | public KeyboardAndMouseProfile() 16 | { 17 | Name = "Keyboard/Mouse"; 18 | Meta = "A keyboard and mouse combination profile appropriate for FPS."; 19 | 20 | // This profile only works on desktops. 21 | SupportedPlatforms = new[] 22 | { 23 | "Windows", 24 | "Mac", 25 | "Linux" 26 | }; 27 | 28 | Sensitivity = 1.0f; 29 | LowerDeadZone = 0.0f; 30 | UpperDeadZone = 1.0f; 31 | 32 | ButtonMappings = new[] 33 | { 34 | new InputControlMapping 35 | { 36 | Handle = "Fire - Mouse", 37 | Target = InputControlType.Action1, 38 | Source = MouseButton0 39 | }, 40 | new InputControlMapping 41 | { 42 | Handle = "Fire - Keyboard", 43 | Target = InputControlType.Action1, 44 | // KeyCodeButton fires when any of the provided KeyCode params are down. 45 | Source = KeyCodeButton( KeyCode.F, KeyCode.Return ) 46 | }, 47 | new InputControlMapping 48 | { 49 | Handle = "AltFire", 50 | Target = InputControlType.Action2, 51 | Source = MouseButton2 52 | }, 53 | new InputControlMapping 54 | { 55 | Handle = "Middle", 56 | Target = InputControlType.Action3, 57 | Source = MouseButton1 58 | }, 59 | new InputControlMapping 60 | { 61 | Handle = "Jump", 62 | Target = InputControlType.Action4, 63 | Source = KeyCodeButton( KeyCode.Space ) 64 | }, 65 | new InputControlMapping 66 | { 67 | Handle = "Combo", 68 | Target = InputControlType.LeftBumper, 69 | // KeyCodeComboButton requires that all KeyCode params are down simultaneously. 70 | Source = KeyCodeComboButton( KeyCode.LeftAlt, KeyCode.Alpha1 ) 71 | }, 72 | }; 73 | 74 | AnalogMappings = new[] 75 | { 76 | new InputControlMapping 77 | { 78 | Handle = "Move X", 79 | Target = InputControlType.LeftStickX, 80 | // KeyCodeAxis splits the two KeyCodes over an axis. The first is negative, the second positive. 81 | Source = KeyCodeAxis( KeyCode.A, KeyCode.D ) 82 | }, 83 | new InputControlMapping 84 | { 85 | Handle = "Move Y", 86 | Target = InputControlType.LeftStickY, 87 | // Notes that up is positive in Unity, therefore the order of KeyCodes is down, up. 88 | Source = KeyCodeAxis( KeyCode.S, KeyCode.W ) 89 | }, 90 | new InputControlMapping { 91 | Handle = "Move X Alternate", 92 | Target = InputControlType.LeftStickX, 93 | Source = KeyCodeAxis( KeyCode.LeftArrow, KeyCode.RightArrow ) 94 | }, 95 | new InputControlMapping { 96 | Handle = "Move Y Alternate", 97 | Target = InputControlType.LeftStickY, 98 | Source = KeyCodeAxis( KeyCode.DownArrow, KeyCode.UpArrow ) 99 | }, 100 | new InputControlMapping 101 | { 102 | Handle = "Look X", 103 | Target = InputControlType.RightStickX, 104 | Source = MouseXAxis, 105 | Raw = true, 106 | Scale = 0.1f 107 | }, 108 | new InputControlMapping 109 | { 110 | Handle = "Look Y", 111 | Target = InputControlType.RightStickY, 112 | Source = MouseYAxis, 113 | Raw = true, 114 | Scale = 0.1f 115 | }, 116 | new InputControlMapping 117 | { 118 | Handle = "Look Z", 119 | Target = InputControlType.ScrollWheel, 120 | Source = MouseScrollWheel, 121 | Raw = true, 122 | Scale = 0.1f 123 | } 124 | }; 125 | } 126 | } 127 | } 128 | 129 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/CustomProfile/KeyboardAndMouseProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 561f4ba8c3a8c4ea8bcb99f80f6997f8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d39a6128dc224f86949b218be6d6583 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/CubeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using InControl; 5 | 6 | 7 | namespace GyroExample 8 | { 9 | // This is kind of "beta"... while it works on iOS, gyro controls are 10 | // inconsistent and are usually fine tuned to the games that use them 11 | // which is somewhat beyond the scope of this project. But, if you 12 | // are curious how to go about it, here you go. 13 | // 14 | public class CubeController : MonoBehaviour 15 | { 16 | void Start() 17 | { 18 | // It seems to take Unity iOS a moment to figure out 19 | // what orientation the device is in, so we wait a bit 20 | // before calibration. 21 | StartCoroutine( CalibrateGyro() ); 22 | } 23 | 24 | 25 | IEnumerator CalibrateGyro() 26 | { 27 | yield return new WaitForSeconds( 0.1f ); 28 | UnityGyroAxisSource.Calibrate(); 29 | } 30 | 31 | 32 | void Update() 33 | { 34 | // Touch screen to recalibrate. 35 | for (int i = 0; i < Input.touchCount; i++) 36 | { 37 | if (Input.GetTouch( i ).phase == TouchPhase.Began) 38 | { 39 | UnityGyroAxisSource.Calibrate(); 40 | } 41 | } 42 | 43 | // Use last device which provided input. 44 | var inputDevice = InputManager.ActiveDevice; 45 | 46 | // Rotate target object with gyroscope mapped to left stick. 47 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.LeftStickX, Space.World ); 48 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.LeftStickY, Space.World ); 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/CubeController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b7ed1f66eeb94ac1b8cab0ab99224c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/Gyro.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/Gyro/Gyro.unity -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/Gyro.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83dc23999005c4cf5978e629ebc96f72 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/GyroProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using InControl; 5 | 6 | 7 | namespace GyroExample 8 | { 9 | // This custom profile is enabled by adding it to the Custom Profiles list 10 | // on the InControlManager script, which is attached to the InControl 11 | // game object in this example scene. 12 | // 13 | public class GyroProfile : UnityInputDeviceProfile 14 | { 15 | public GyroProfile() 16 | { 17 | Name = "Gyroscope"; 18 | Meta = "Gyroscope on iOS."; 19 | 20 | // This profile only works on mobile. 21 | SupportedPlatforms = new[] 22 | { 23 | "iPhone", 24 | "Android" 25 | }; 26 | 27 | ButtonMappings = new InputControlMapping[] 28 | { 29 | }; 30 | 31 | AnalogMappings = new[] 32 | { 33 | new InputControlMapping 34 | { 35 | Handle = "Move X", 36 | Target = InputControlType.LeftStickX, 37 | Source = new UnityGyroAxisSource( UnityGyroAxisSource.GyroAxis.X ), 38 | Raw = true, 39 | Scale = 3.0f 40 | }, 41 | new InputControlMapping 42 | { 43 | Handle = "Move Y", 44 | Target = InputControlType.LeftStickY, 45 | Source = new UnityGyroAxisSource( UnityGyroAxisSource.GyroAxis.Y ), 46 | Raw = true, 47 | Scale = 3.0f 48 | }, 49 | }; 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Gyro/GyroProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4082e25628c14cd8871f876549a9c1f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe47427c5b38642a8963598d8003e895 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/Button.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using InControl; 4 | 5 | 6 | namespace InterfaceMovement 7 | { 8 | public class Button : MonoBehaviour 9 | { 10 | public Button up = null; 11 | public Button down = null; 12 | public Button left = null; 13 | public Button right = null; 14 | Renderer cubeRenderer; 15 | 16 | 17 | void Start() 18 | { 19 | cubeRenderer = GetComponent(); 20 | } 21 | 22 | 23 | void Update() 24 | { 25 | // Find out if we're the focused button. 26 | bool hasFocus = transform.parent.GetComponent().focusedButton == this; 27 | 28 | // Fade alpha in and out depending on focus. 29 | var color = cubeRenderer.material.color; 30 | color.a = Mathf.MoveTowards( color.a, hasFocus ? 1.0f : 0.5f, Time.deltaTime * 3.0f ); 31 | cubeRenderer.material.color = color; 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/Button.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9095497a2faaa4e7f8d8a1b97bf3a9a0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonFocus.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | 4 | namespace InterfaceMovement 5 | { 6 | public class ButtonFocus : MonoBehaviour 7 | { 8 | void Update() 9 | { 10 | // Get focused button. 11 | var focusedButton = transform.parent.GetComponent().focusedButton; 12 | 13 | // Move toward same position as focused button. 14 | transform.position = Vector3.MoveTowards( transform.position, focusedButton.transform.position, Time.deltaTime * 10.0f ); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonFocus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 371978769d23141ebb4d88fc2804f4c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonFocusMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/InterfaceMovement/ButtonFocusMaterial.mat -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonFocusMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8fc7c64c0905484388746b372551e50 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using InControl; 3 | 4 | 5 | namespace InterfaceMovement 6 | { 7 | public class ButtonManager : MonoBehaviour 8 | { 9 | public Button focusedButton; 10 | 11 | 12 | void Awake() 13 | { 14 | TwoAxisInputControl.StateThreshold = 0.7f; 15 | } 16 | 17 | 18 | void Update() 19 | { 20 | // Use last device which provided input. 21 | var inputDevice = InputManager.ActiveDevice; 22 | 23 | // Move focus with directional inputs. 24 | if (inputDevice.Direction.Up.WasPressed) 25 | MoveFocusTo( focusedButton.up ); 26 | 27 | if (inputDevice.Direction.Down.WasPressed) 28 | MoveFocusTo( focusedButton.down ); 29 | 30 | if (inputDevice.Direction.Left.WasPressed) 31 | MoveFocusTo( focusedButton.left ); 32 | 33 | if (inputDevice.Direction.Right.WasPressed) 34 | MoveFocusTo( focusedButton.right ); 35 | } 36 | 37 | 38 | void MoveFocusTo( Button newFocusedButton ) 39 | { 40 | if (newFocusedButton != null) 41 | { 42 | focusedButton = newFocusedButton; 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3762844a2b3c4a41aac749ce321e7f9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/InterfaceMovement/ButtonMaterial.mat -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/ButtonMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1883894b44c234cf08c7cc630e31bd90 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/InterfaceMovement.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/InterfaceMovement/InterfaceMovement.unity -------------------------------------------------------------------------------- /Assets/InControl/Examples/InterfaceMovement/InterfaceMovement.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86b67926fdca746d1a387b9782cb5bd7 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8cc44d1c64b947329a8c073609650bf 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/CubeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using InControl; 4 | 5 | 6 | namespace MultiplayerExample 7 | { 8 | public class CubeController : MonoBehaviour 9 | { 10 | public int playerNum; 11 | Renderer cubeRenderer; 12 | 13 | 14 | void Start() 15 | { 16 | cubeRenderer = GetComponent(); 17 | } 18 | 19 | 20 | void Update() 21 | { 22 | var inputDevice = (InputManager.Devices.Count > playerNum) ? InputManager.Devices[playerNum] : null; 23 | if (inputDevice == null) 24 | { 25 | // If no controller exists for this cube, just make it translucent. 26 | cubeRenderer.material.color = new Color( 1.0f, 1.0f, 1.0f, 0.2f ); 27 | } 28 | else 29 | { 30 | UpdateCubeWithInputDevice( inputDevice ); 31 | } 32 | } 33 | 34 | 35 | void UpdateCubeWithInputDevice( InputDevice inputDevice ) 36 | { 37 | // Set object material color based on which action is pressed. 38 | if (inputDevice.Action1) 39 | { 40 | cubeRenderer.material.color = Color.green; 41 | } 42 | else 43 | if (inputDevice.Action2) 44 | { 45 | cubeRenderer.material.color = Color.red; 46 | } 47 | else 48 | if (inputDevice.Action3) 49 | { 50 | cubeRenderer.material.color = Color.blue; 51 | } 52 | else 53 | if (inputDevice.Action4) 54 | { 55 | cubeRenderer.material.color = Color.yellow; 56 | } 57 | else 58 | { 59 | cubeRenderer.material.color = Color.white; 60 | } 61 | 62 | // Rotate target object with both sticks and d-pad. 63 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.Direction.X, Space.World ); 64 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.Direction.Y, Space.World ); 65 | transform.Rotate( Vector3.down, 500.0f * Time.deltaTime * inputDevice.RightStickX, Space.World ); 66 | transform.Rotate( Vector3.right, 500.0f * Time.deltaTime * inputDevice.RightStickY, Space.World ); 67 | } 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/CubeController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 549e9581c35454588bc611a50b55a068 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/CubeMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/Multiplayer/CubeMaterial.mat -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/CubeMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a231c9df791c14429a94ed44c83562da 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/Multiplayer.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Examples/Multiplayer/Multiplayer.unity -------------------------------------------------------------------------------- /Assets/InControl/Examples/Multiplayer/Multiplayer.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2541a3efd04d6481e89368bebf366766 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/README.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18617c681ed2c4a4384fd6c7370d5e4a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/README/README.txt: -------------------------------------------------------------------------------- 1 | ## InControl 2 | 3 | Documentation and additional information is available online at: 4 | http://www.gallantgames.com/incontrol 5 | 6 | ## JavaScript 7 | 8 | InControl is written in C#, but it can also be used with JavaScript. To access it from JavaScript, create a folder under the 'Assets' folder named 'Plugins' and move the 'InControl' folder inside. You will also need to add 'import InControl;' to the top of your JavaScript files. For projects using InControl from C#, none of this is necessary. For more information, please see the [Unity documentation on Special Folders and Script Compilation Order at http://docs.unity3d.com/Documentation/Manual/ScriptCompileOrderFolders.html 9 | 10 | -------------------------------------------------------------------------------- /Assets/InControl/README/README.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2201e8f3f9b3f49e19953d16857f067e 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Source.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb5a5deff7b3a49aea18f6b71f90ba2a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ade708e11ded453d9520019bb348a5f 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/HeaderAttribute.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_4_3 2 | 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | using UnityEngine; 7 | 8 | 9 | namespace InControl 10 | { 11 | public class HeaderAttribute : PropertyAttribute 12 | { 13 | public string header; 14 | 15 | public HeaderAttribute(string header) 16 | { 17 | this.header = header; 18 | } 19 | } 20 | 21 | #if UNITY_EDITOR 22 | [CustomPropertyDrawer(typeof(HeaderAttribute))] 23 | public class HeaderDrawer : PropertyDrawer 24 | { 25 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 26 | { 27 | return EditorGUI.GetPropertyHeight(property, label) + (EditorGUIUtility.singleLineHeight * 1.5f); 28 | } 29 | 30 | 31 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 32 | { 33 | var headerAttribute = attribute as HeaderAttribute; 34 | var propertyHeight = position.height - (EditorGUIUtility.singleLineHeight * 1.5f); 35 | 36 | position.y += EditorGUIUtility.singleLineHeight * 0.5f; 37 | position.height = EditorGUIUtility.singleLineHeight; 38 | EditorGUI.LabelField(position, headerAttribute.header, EditorStyles.boldLabel); 39 | 40 | position.y += EditorGUIUtility.singleLineHeight; 41 | position.height = propertyHeight; 42 | EditorGUI.PropertyField(position, property); 43 | } 44 | } 45 | #endif 46 | } 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/HeaderAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6f9df388a384442bb101cc67126f194 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/RangeAttribute.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_4_3 2 | 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | using UnityEngine; 7 | 8 | 9 | namespace InControl 10 | { 11 | public class RangeAttribute : PropertyAttribute 12 | { 13 | public float min; 14 | public float max; 15 | 16 | public RangeAttribute(float min, float max) 17 | { 18 | this.min = min; 19 | this.max = max; 20 | } 21 | } 22 | 23 | #if UNITY_EDITOR 24 | [CustomPropertyDrawer(typeof(RangeAttribute))] 25 | public class RangeDrawer : PropertyDrawer 26 | { 27 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 28 | { 29 | var rangeAttribute = attribute as RangeAttribute; 30 | if (property.propertyType == SerializedPropertyType.Float) 31 | { 32 | EditorGUI.Slider(position, property, rangeAttribute.min, rangeAttribute.max, label); 33 | } 34 | else 35 | if (property.propertyType == SerializedPropertyType.Integer) 36 | { 37 | EditorGUI.IntSlider(position, property, (int)rangeAttribute.min, (int)rangeAttribute.max, label); 38 | } 39 | } 40 | } 41 | #endif 42 | } 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/RangeAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6658719ee0a0544fdbce2ed84ae60f09 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/SpaceAttribute.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_4_3 2 | 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | using UnityEngine; 7 | 8 | 9 | namespace InControl 10 | { 11 | public class SpaceAttribute : PropertyAttribute 12 | { 13 | public int space; 14 | 15 | public SpaceAttribute(int space) 16 | { 17 | this.space = space; 18 | } 19 | } 20 | 21 | #if UNITY_EDITOR 22 | [CustomPropertyDrawer(typeof(SpaceAttribute))] 23 | public class SpaceDrawer : PropertyDrawer 24 | { 25 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 26 | { 27 | var spaceAttribute = attribute as SpaceAttribute; 28 | return EditorGUI.GetPropertyHeight(property, label) + spaceAttribute.space; 29 | } 30 | 31 | 32 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 33 | { 34 | var spaceAttribute = attribute as SpaceAttribute; 35 | position.y += spaceAttribute.space; 36 | position.height -= spaceAttribute.space; 37 | EditorGUI.PropertyField(position, property, label); 38 | } 39 | } 40 | #endif 41 | } 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Compatibility/SpaceAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0d6089ba8556408882dca53437e776e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbb8aeed17d054bf09b5caf08bcb3132 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Components/InControlManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | using UnityEngine; 6 | 7 | 8 | namespace InControl 9 | { 10 | public class InControlManager : MonoBehaviour 11 | { 12 | public bool logDebugInfo = false; 13 | public bool invertYAxis = false; 14 | public bool enableXInput = false; 15 | public bool useFixedUpdate = false; 16 | public bool dontDestroyOnLoad = false; 17 | public List customProfiles = new List(); 18 | 19 | 20 | void OnEnable() 21 | { 22 | if (logDebugInfo) 23 | { 24 | Debug.Log( "InControl (version " + InputManager.Version + ")" ); 25 | Logger.OnLogMessage += HandleOnLogMessage; 26 | } 27 | 28 | InputManager.InvertYAxis = invertYAxis; 29 | InputManager.EnableXInput = enableXInput; 30 | InputManager.SetupInternal(); 31 | 32 | foreach (var className in customProfiles) 33 | { 34 | var classType = Type.GetType( className ); 35 | if (classType == null) 36 | { 37 | Debug.LogError( "Cannot find class for custom profile: " + className ); 38 | } 39 | else 40 | { 41 | var customProfileInstance = Activator.CreateInstance( classType ) as UnityInputDeviceProfile; 42 | InputManager.AttachDevice( new UnityInputDevice( customProfileInstance ) ); 43 | } 44 | } 45 | 46 | if (dontDestroyOnLoad) 47 | { 48 | DontDestroyOnLoad( this ); 49 | } 50 | } 51 | 52 | 53 | void OnDisable() 54 | { 55 | InputManager.ResetInternal(); 56 | } 57 | 58 | 59 | #if UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR 60 | void Start() 61 | { 62 | StartCoroutine( CheckForOuyaEverywhereSupport() ); 63 | } 64 | 65 | 66 | IEnumerator CheckForOuyaEverywhereSupport() 67 | { 68 | while (!OuyaSDK.isIAPInitComplete()) 69 | { 70 | yield return null; 71 | } 72 | 73 | OuyaEverywhereDeviceManager.Enable(); 74 | } 75 | #endif 76 | 77 | 78 | void Update() 79 | { 80 | if (!useFixedUpdate || Mathf.Approximately( Time.timeScale, 0.0f )) 81 | { 82 | InputManager.UpdateInternal(); 83 | } 84 | } 85 | 86 | 87 | void FixedUpdate() 88 | { 89 | if (useFixedUpdate) 90 | { 91 | InputManager.UpdateInternal(); 92 | } 93 | } 94 | 95 | 96 | void OnApplicationFocus( bool focusState ) 97 | { 98 | InputManager.OnApplicationFocus( focusState ); 99 | } 100 | 101 | 102 | void OnApplicationPause( bool pauseState ) 103 | { 104 | InputManager.OnApplicationPause( pauseState ); 105 | } 106 | 107 | 108 | void OnApplicationQuit() 109 | { 110 | InputManager.OnApplicationQuit(); 111 | } 112 | 113 | 114 | void HandleOnLogMessage( LogMessage logMessage ) 115 | { 116 | switch (logMessage.type) 117 | { 118 | case LogMessageType.Info: 119 | Debug.Log( logMessage.text ); 120 | break; 121 | case LogMessageType.Warning: 122 | Debug.LogWarning( logMessage.text ); 123 | break; 124 | case LogMessageType.Error: 125 | Debug.LogError( logMessage.text ); 126 | break; 127 | } 128 | } 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Components/InControlManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7b5e8de77c5b4597ae7fbfb49a95e22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: -100 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5129e41cb4894418791a34cb3f4fa246 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a331fa841dd36460cb3c9805af10b205 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlMapping.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class InputControlMapping 8 | { 9 | public class Range 10 | { 11 | public static Range Complete = new Range { Minimum = -1.0f, Maximum = 1.0f }; 12 | public static Range Positive = new Range { Minimum = 0.0f, Maximum = 1.0f }; 13 | public static Range Negative = new Range { Minimum = -1.0f, Maximum = 0.0f }; 14 | 15 | public float Minimum; 16 | public float Maximum; 17 | } 18 | 19 | 20 | public InputControlSource Source; 21 | public InputControlType Target; 22 | 23 | // Invert the final mapped value. 24 | public bool Invert; 25 | 26 | // Analog values will be multiplied by this number before processing. 27 | public float Scale = 1.0f; 28 | 29 | // Raw inputs won't be processed except for scaling (mice and trackpads). 30 | public bool Raw; 31 | 32 | // This is primarily to fix a bug with the wired Xbox controller on Mac. 33 | public bool IgnoreInitialZeroValue; 34 | 35 | public Range SourceRange = Range.Complete; 36 | public Range TargetRange = Range.Complete; 37 | 38 | string handle; 39 | 40 | 41 | public float MapValue( float value ) 42 | { 43 | float sourceValue; 44 | float targetValue; 45 | 46 | if (Raw) 47 | { 48 | targetValue = value * Scale; 49 | } 50 | else 51 | { 52 | // Scale value and clamp to a legal range. 53 | value = Mathf.Clamp( value * Scale, -1.0f, 1.0f ); 54 | 55 | // Values outside of source range are invalid and return zero. 56 | if (value < SourceRange.Minimum || value > SourceRange.Maximum) 57 | { 58 | return 0.0f; 59 | } 60 | 61 | // Remap from source range to target range. 62 | sourceValue = Mathf.InverseLerp( SourceRange.Minimum, SourceRange.Maximum, value ); 63 | targetValue = Mathf.Lerp( TargetRange.Minimum, TargetRange.Maximum, sourceValue ); 64 | } 65 | 66 | if (Invert ^ (IsYAxis && InputManager.InvertYAxis)) 67 | { 68 | targetValue = -targetValue; 69 | } 70 | 71 | return targetValue; 72 | } 73 | 74 | 75 | public string Handle 76 | { 77 | get { return (string.IsNullOrEmpty( handle )) ? Target.ToString() : handle; } 78 | set { handle = value; } 79 | } 80 | 81 | 82 | bool IsYAxis 83 | { 84 | get 85 | { 86 | return Target == InputControlType.LeftStickY || 87 | Target == InputControlType.RightStickY; 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlMapping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 158934c73677f4587a09b752977c95cb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | public interface InputControlSource 7 | { 8 | float GetValue( InputDevice inputDevice ); 9 | bool GetState( InputDevice inputDevice ); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8357bf40f8764dd490da258112083f5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlState.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | #pragma warning disable 0660, 0661 5 | 6 | 7 | namespace InControl 8 | { 9 | public struct InputControlState 10 | { 11 | public bool State; 12 | public float Value; 13 | 14 | 15 | public void Reset() 16 | { 17 | Value = 0.0f; 18 | State = false; 19 | } 20 | 21 | 22 | public void Set( float value ) 23 | { 24 | Value = value; 25 | State = !Mathf.Approximately( value, 0.0f ); 26 | } 27 | 28 | 29 | public void Set( float value, float threshold ) 30 | { 31 | Value = value; 32 | State = Mathf.Abs( value ) > threshold; 33 | } 34 | 35 | 36 | public void Set( bool state ) 37 | { 38 | State = state; 39 | Value = state ? 1.0f : 0.0f; 40 | } 41 | 42 | 43 | public static implicit operator bool( InputControlState state ) 44 | { 45 | return state.State; 46 | } 47 | 48 | 49 | public static implicit operator float( InputControlState state ) 50 | { 51 | return state.Value; 52 | } 53 | 54 | 55 | public static bool operator ==( InputControlState a, InputControlState b ) 56 | { 57 | return Mathf.Approximately( a.Value, b.Value ); 58 | } 59 | 60 | 61 | public static bool operator !=( InputControlState a, InputControlState b ) 62 | { 63 | return !Mathf.Approximately( a.Value, b.Value ); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59bdf6bbbd3674d9daca7fc11231fcb6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // TODO: This should be renamed to InputControlTarget. 7 | public enum InputControlType : int 8 | { 9 | None = 0, 10 | 11 | // Standardized. 12 | // 13 | LeftStickX, 14 | LeftStickY, 15 | LeftStickButton, 16 | 17 | RightStickX, 18 | RightStickY, 19 | RightStickButton, 20 | 21 | DPadUp, 22 | DPadDown, 23 | DPadLeft, 24 | DPadRight, 25 | 26 | Action1, 27 | Action2, 28 | Action3, 29 | Action4, 30 | 31 | LeftTrigger, 32 | RightTrigger, 33 | 34 | LeftBumper, 35 | RightBumper, 36 | 37 | 38 | // Not standardized, but provided for convenience. 39 | // 40 | Back, 41 | Start, 42 | Select, 43 | System, 44 | Pause, 45 | Menu, 46 | Share, 47 | View, 48 | Options, 49 | TiltX, 50 | TiltY, 51 | TiltZ, 52 | ScrollWheel, 53 | TouchPadTap, 54 | TouchPadXAxis, 55 | TouchPadYAxis, 56 | 57 | 58 | // Not standardized. 59 | // 60 | Analog0, 61 | Analog1, 62 | Analog2, 63 | Analog3, 64 | Analog4, 65 | Analog5, 66 | Analog6, 67 | Analog7, 68 | Analog8, 69 | Analog9, 70 | Analog10, 71 | Analog11, 72 | Analog12, 73 | Analog13, 74 | Analog14, 75 | Analog15, 76 | Analog16, 77 | Analog17, 78 | Analog18, 79 | Analog19, 80 | 81 | Button0, 82 | Button1, 83 | Button2, 84 | Button3, 85 | Button4, 86 | Button5, 87 | Button6, 88 | Button7, 89 | Button8, 90 | Button9, 91 | Button10, 92 | Button11, 93 | Button12, 94 | Button13, 95 | Button14, 96 | Button15, 97 | Button16, 98 | Button17, 99 | Button18, 100 | Button19, 101 | 102 | 103 | // Internal. Must be last. 104 | // 105 | Count 106 | } 107 | } 108 | 109 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/InputControlType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5183b915a2b5b4330bad2dcfdcbe9013 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/OneAxisInputControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class OneAxisInputControl 8 | { 9 | public ulong UpdateTick { get; private set; } 10 | 11 | InputControlState thisState; 12 | InputControlState lastState; 13 | 14 | 15 | public void UpdateWithValue( float value, ulong updateTick, float stateThreshold ) 16 | { 17 | if (UpdateTick > updateTick) 18 | { 19 | throw new InvalidOperationException( "A control cannot be updated with an earlier tick." ); 20 | } 21 | 22 | lastState = thisState; 23 | 24 | thisState.Set( value, stateThreshold ); 25 | 26 | if (thisState != lastState) 27 | { 28 | UpdateTick = updateTick; 29 | } 30 | } 31 | 32 | 33 | public bool State 34 | { 35 | get { return thisState.State; } 36 | } 37 | 38 | 39 | public bool LastState 40 | { 41 | get { return lastState.State; } 42 | } 43 | 44 | 45 | public float Value 46 | { 47 | get { return thisState.Value; } 48 | } 49 | 50 | 51 | public float LastValue 52 | { 53 | get { return lastState.Value; } 54 | } 55 | 56 | 57 | public bool HasChanged 58 | { 59 | get { return thisState != lastState; } 60 | } 61 | 62 | 63 | public bool IsPressed 64 | { 65 | get { return thisState.State; } 66 | } 67 | 68 | 69 | public bool WasPressed 70 | { 71 | get { return thisState && !lastState; } 72 | } 73 | 74 | 75 | public bool WasReleased 76 | { 77 | get { return !thisState && lastState; } 78 | } 79 | 80 | 81 | public static implicit operator bool( OneAxisInputControl control ) 82 | { 83 | return control.State; 84 | } 85 | 86 | 87 | public static implicit operator float( OneAxisInputControl control ) 88 | { 89 | return control.Value; 90 | } 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/OneAxisInputControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f64459b0e09934afba39eef3f4bff61b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/TwoAxisInputControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class TwoAxisInputControl 8 | { 9 | public float X { get; protected set; } 10 | public float Y { get; protected set; } 11 | 12 | public OneAxisInputControl Left { get; protected set; } 13 | public OneAxisInputControl Right { get; protected set; } 14 | public OneAxisInputControl Up { get; protected set; } 15 | public OneAxisInputControl Down { get; protected set; } 16 | 17 | public ulong UpdateTick { get; protected set; } 18 | 19 | bool thisState; 20 | bool lastState; 21 | 22 | public static float StateThreshold = 0.0f; 23 | 24 | 25 | internal TwoAxisInputControl() 26 | { 27 | Left = new OneAxisInputControl(); 28 | Right = new OneAxisInputControl(); 29 | Up = new OneAxisInputControl(); 30 | Down = new OneAxisInputControl(); 31 | } 32 | 33 | 34 | internal void Update( float x, float y, ulong updateTick ) 35 | { 36 | lastState = thisState; 37 | 38 | X = x; 39 | Y = y; 40 | 41 | Left.UpdateWithValue( Mathf.Clamp01( -X ), updateTick, StateThreshold ); 42 | Right.UpdateWithValue( Mathf.Clamp01( X ), updateTick, StateThreshold ); 43 | 44 | if (InputManager.InvertYAxis) 45 | { 46 | Up.UpdateWithValue( Mathf.Clamp01( -Y ), updateTick, StateThreshold ); 47 | Down.UpdateWithValue( Mathf.Clamp01( Y ), updateTick, StateThreshold ); 48 | } 49 | else 50 | { 51 | Up.UpdateWithValue( Mathf.Clamp01( Y ), updateTick, StateThreshold ); 52 | Down.UpdateWithValue( Mathf.Clamp01( -Y ), updateTick, StateThreshold ); 53 | } 54 | 55 | thisState = Up.State || Down.State || Left.State || Right.State; 56 | 57 | if (thisState != lastState) 58 | { 59 | UpdateTick = updateTick; 60 | } 61 | } 62 | 63 | 64 | public bool State 65 | { 66 | get { return thisState; } 67 | } 68 | 69 | 70 | public bool HasChanged 71 | { 72 | get { return thisState != lastState; } 73 | } 74 | 75 | 76 | public Vector2 Vector 77 | { 78 | get { return new Vector2( X, Y ); } 79 | } 80 | 81 | 82 | public static implicit operator bool( TwoAxisInputControl control ) 83 | { 84 | return control.thisState; 85 | } 86 | 87 | 88 | public static implicit operator Vector2( TwoAxisInputControl control ) 89 | { 90 | return control.Vector; 91 | } 92 | 93 | 94 | public static implicit operator Vector3( TwoAxisInputControl control ) 95 | { 96 | return new Vector3( control.X, control.Y ); 97 | } 98 | } 99 | } 100 | 101 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Control/TwoAxisInputControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f1825cfc5dae489c84b73d77137794a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Debug.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ffbcd970700f46468bc10430f6b2817 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Debug/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public enum LogMessageType 8 | { 9 | Info, 10 | Warning, 11 | Error 12 | } 13 | 14 | 15 | public struct LogMessage 16 | { 17 | public string text; 18 | public LogMessageType type; 19 | } 20 | 21 | 22 | public class Logger 23 | { 24 | public delegate void LogMessageHandler( LogMessage message ); 25 | public static event LogMessageHandler OnLogMessage; 26 | 27 | 28 | public static void LogInfo( string text ) 29 | { 30 | if (OnLogMessage != null) 31 | { 32 | var logMessage = new LogMessage() { text = text, type = LogMessageType.Info }; 33 | OnLogMessage( logMessage ); 34 | } 35 | } 36 | 37 | 38 | public static void LogWarning( string text ) 39 | { 40 | if (OnLogMessage != null) 41 | { 42 | var logMessage = new LogMessage() { text = text, type = LogMessageType.Warning }; 43 | OnLogMessage( logMessage ); 44 | } 45 | } 46 | 47 | 48 | public static void LogError( string text ) 49 | { 50 | if (OnLogMessage != null) 51 | { 52 | var logMessage = new LogMessage() { text = text, type = LogMessageType.Error }; 53 | OnLogMessage( logMessage ); 54 | } 55 | } 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Debug/Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e434901b21a544b58614da9f38cb261 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Device.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 866a38a3ac2004ca89da2105270af2ba 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Device/InputDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe926333032524309be5399211293619 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Device/InputDeviceManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using System.Reflection; 6 | 7 | 8 | namespace InControl 9 | { 10 | public class InputDeviceManager 11 | { 12 | protected List devices = new List(); 13 | 14 | 15 | public virtual void Update( ulong updateTick, float deltaTime ) 16 | { 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Device/InputDeviceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcfac7f074e8e41b289eccbdbf6229fc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/InputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 647aa14c38a6340e3a7082b11893f570 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 150a4a76c193342489c524c64dde8900 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52d34438b966f4281a081b67877d60cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityAnalogSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityAnalogSource : InputControlSource 8 | { 9 | int analogId; 10 | static string[,] analogQueries; 11 | 12 | 13 | public UnityAnalogSource( int analogId ) 14 | { 15 | this.analogId = analogId; 16 | SetupAnalogQueries(); 17 | } 18 | 19 | 20 | public float GetValue( InputDevice inputDevice ) 21 | { 22 | var joystickId = (inputDevice as UnityInputDevice).JoystickId; 23 | var analogKey = GetAnalogKey( joystickId, analogId ); 24 | return Input.GetAxisRaw( analogKey ); 25 | } 26 | 27 | 28 | public bool GetState( InputDevice inputDevice ) 29 | { 30 | return !Mathf.Approximately( GetValue( inputDevice ), 0.0f ); 31 | } 32 | 33 | 34 | static void SetupAnalogQueries() 35 | { 36 | if (analogQueries == null) 37 | { 38 | analogQueries = new string[ UnityInputDevice.MaxDevices, UnityInputDevice.MaxAnalogs ]; 39 | 40 | for (int joystickId = 1; joystickId <= UnityInputDevice.MaxDevices; joystickId++) 41 | { 42 | for (int analogId = 0; analogId < UnityInputDevice.MaxAnalogs; analogId++) 43 | { 44 | analogQueries[ joystickId - 1, analogId ] = "joystick " + joystickId + " analog " + analogId; 45 | } 46 | } 47 | } 48 | } 49 | 50 | 51 | static string GetAnalogKey( int joystickId, int analogId ) 52 | { 53 | return analogQueries[ joystickId - 1, analogId ]; 54 | } 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityAnalogSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a287debc819324ea4b4878fbe872d89b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityButtonSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityButtonSource : InputControlSource 8 | { 9 | int buttonId; 10 | static string[,] buttonQueries; 11 | 12 | 13 | public UnityButtonSource( int buttonId ) 14 | { 15 | this.buttonId = buttonId; 16 | SetupButtonQueries(); 17 | } 18 | 19 | 20 | public float GetValue( InputDevice inputDevice ) 21 | { 22 | return GetState( inputDevice ) ? 1.0f : 0.0f; 23 | } 24 | 25 | 26 | public bool GetState( InputDevice inputDevice ) 27 | { 28 | var joystickId = (inputDevice as UnityInputDevice).JoystickId; 29 | var buttonKey = GetButtonKey( joystickId, buttonId ); 30 | return Input.GetKey( buttonKey ); 31 | } 32 | 33 | 34 | static void SetupButtonQueries() 35 | { 36 | if (buttonQueries == null) 37 | { 38 | buttonQueries = new string[ UnityInputDevice.MaxDevices, UnityInputDevice.MaxButtons ]; 39 | 40 | for (int joystickId = 1; joystickId <= UnityInputDevice.MaxDevices; joystickId++) 41 | { 42 | for (int buttonId = 0; buttonId < UnityInputDevice.MaxButtons; buttonId++) 43 | { 44 | buttonQueries[ joystickId - 1, buttonId ] = "joystick " + joystickId + " button " + buttonId; 45 | } 46 | } 47 | } 48 | } 49 | 50 | 51 | static string GetButtonKey( int joystickId, int buttonId ) 52 | { 53 | return buttonQueries[ joystickId - 1, buttonId ]; 54 | } 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityButtonSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1828b10a143a3467193aaf26703acb34 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityGyroAxisSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | // This is kind of "beta"... while it works on iOS, gyro controls are 8 | // inconsistent and are usually fine tuned to the games that use them 9 | // which is somewhat beyond the scope of this project. But, if you 10 | // are curious how to go about it, here you go. 11 | // 12 | public class UnityGyroAxisSource : InputControlSource 13 | { 14 | public enum GyroAxis 15 | { 16 | X = 0, 17 | Y = 1, 18 | } 19 | 20 | int axis; 21 | 22 | static Quaternion zeroAttitude; 23 | 24 | 25 | public UnityGyroAxisSource( GyroAxis axis ) 26 | { 27 | this.axis = (int) axis; 28 | Calibrate(); 29 | } 30 | 31 | 32 | public float GetValue( InputDevice inputDevice ) 33 | { 34 | return GetAxis()[ (int) axis ]; 35 | } 36 | 37 | 38 | public bool GetState( InputDevice inputDevice ) 39 | { 40 | return !Mathf.Approximately( GetValue( inputDevice ), 0.0f ); 41 | } 42 | 43 | 44 | static Quaternion GetAttitude() 45 | { 46 | return Quaternion.Inverse( zeroAttitude ) * Input.gyro.attitude; 47 | } 48 | 49 | 50 | static Vector3 GetAxis() 51 | { 52 | var gv = GetAttitude() * Vector3.forward; 53 | var gx = ApplyDeadZone( Mathf.Clamp( gv.x, -1.0f, 1.0f ) ); 54 | var gy = ApplyDeadZone( Mathf.Clamp( gv.y, -1.0f, 1.0f ) ); 55 | return new Vector3( gx, gy ); 56 | } 57 | 58 | 59 | static float ApplyDeadZone( float value ) 60 | { 61 | return Mathf.InverseLerp( 0.05f, 1.0f, Mathf.Abs( value ) ) * Mathf.Sign( value ); 62 | } 63 | 64 | 65 | public static void Calibrate() 66 | { 67 | zeroAttitude = Input.gyro.attitude; 68 | } 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityGyroAxisSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8ddb2e45a0dd43d6b15d07d83e16204 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeAxisSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityKeyCodeAxisSource : InputControlSource 8 | { 9 | KeyCode negativeKeyCode; 10 | KeyCode positiveKeyCode; 11 | 12 | 13 | public UnityKeyCodeAxisSource( KeyCode negativeKeyCode, KeyCode positiveKeyCode ) 14 | { 15 | this.negativeKeyCode = negativeKeyCode; 16 | this.positiveKeyCode = positiveKeyCode; 17 | } 18 | 19 | 20 | public float GetValue( InputDevice inputDevice ) 21 | { 22 | int axisValue = 0; 23 | 24 | if (Input.GetKey( negativeKeyCode )) 25 | { 26 | axisValue--; 27 | } 28 | 29 | if (Input.GetKey( positiveKeyCode )) 30 | { 31 | axisValue++; 32 | } 33 | 34 | return axisValue; 35 | } 36 | 37 | 38 | public bool GetState( InputDevice inputDevice ) 39 | { 40 | return !Mathf.Approximately( GetValue( inputDevice ), 0.0f ); 41 | } 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeAxisSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 20964e0f5fde540aaa0888995c733abc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeComboSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityKeyCodeComboSource : InputControlSource 8 | { 9 | KeyCode[] keyCodeList; 10 | 11 | 12 | public UnityKeyCodeComboSource( params KeyCode[] keyCodeList ) 13 | { 14 | this.keyCodeList = keyCodeList; 15 | } 16 | 17 | 18 | public float GetValue( InputDevice inputDevice ) 19 | { 20 | return GetState( inputDevice ) ? 1.0f : 0.0f; 21 | } 22 | 23 | 24 | public bool GetState( InputDevice inputDevice ) 25 | { 26 | for (int i = 0; i < keyCodeList.Length; i++) 27 | { 28 | if (!Input.GetKey( keyCodeList[i] )) 29 | { 30 | return false; 31 | } 32 | } 33 | return true; 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeComboSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fee4c0056ff6454392967ac294b4376 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityKeyCodeSource : InputControlSource 8 | { 9 | KeyCode[] keyCodeList; 10 | 11 | 12 | public UnityKeyCodeSource( params KeyCode[] keyCodeList ) 13 | { 14 | this.keyCodeList = keyCodeList; 15 | } 16 | 17 | 18 | public float GetValue( InputDevice inputDevice ) 19 | { 20 | return GetState( inputDevice ) ? 1.0f : 0.0f; 21 | } 22 | 23 | 24 | public bool GetState( InputDevice inputDevice ) 25 | { 26 | for (int i = 0; i < keyCodeList.Length; i++) 27 | { 28 | if (Input.GetKey( keyCodeList[i] )) 29 | { 30 | return true; 31 | } 32 | } 33 | return false; 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityKeyCodeSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca04a9e9a03084c3da32288c5df304c5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityMouseAxisSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityMouseAxisSource : InputControlSource 8 | { 9 | string mouseAxisQuery; 10 | 11 | 12 | public UnityMouseAxisSource( string axis ) 13 | { 14 | this.mouseAxisQuery = "mouse " + axis; 15 | } 16 | 17 | 18 | public float GetValue( InputDevice inputDevice ) 19 | { 20 | return Input.GetAxisRaw( mouseAxisQuery ); 21 | } 22 | 23 | 24 | public bool GetState( InputDevice inputDevice ) 25 | { 26 | return !Mathf.Approximately( GetValue( inputDevice ), 0.0f ); 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityMouseAxisSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adbf4a4d2a1634dc98bc2527ea9b6bef 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityMouseButtonSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityMouseButtonSource : InputControlSource 8 | { 9 | int buttonId; 10 | 11 | 12 | public UnityMouseButtonSource( int buttonId ) 13 | { 14 | this.buttonId = buttonId; 15 | } 16 | 17 | 18 | public float GetValue( InputDevice inputDevice ) 19 | { 20 | return GetState( inputDevice ) ? 1.0f : 0.0f; 21 | } 22 | 23 | 24 | public bool GetState( InputDevice inputDevice ) 25 | { 26 | return Input.GetMouseButton( buttonId ); 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/ControlSources/UnityMouseButtonSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30f8614bb307f4ce68354078dcacfbb0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55b6c0c71dff44ff4aaf41c53f3e73d9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AmazonFireTVProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c725c752a36741809fad8d59e38180f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AmazonFireTVRemoteProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class AmazonFireTVRemote : UnityInputDeviceProfile 9 | { 10 | public AmazonFireTVRemote() 11 | { 12 | Name = "Amazon Fire TV Remote"; 13 | Meta = "Amazon Fire TV Remote on Amazon Fire TV"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Amazon AFTB", 17 | "Amazon AFTM" 18 | }; 19 | 20 | JoystickNames = new[] { 21 | "", 22 | "Amazon Fire TV Remote" 23 | }; 24 | 25 | ButtonMappings = new[] { 26 | new InputControlMapping { 27 | Handle = "A", 28 | Target = InputControlType.Action1, 29 | Source = Button0 30 | }, 31 | new InputControlMapping { 32 | Handle = "Back", 33 | Target = InputControlType.Select, 34 | Source = KeyCodeButton( UnityEngine.KeyCode.Escape ) 35 | } 36 | }; 37 | 38 | AnalogMappings = new[] { 39 | new InputControlMapping { 40 | Handle = "DPad Left", 41 | Target = InputControlType.DPadLeft, 42 | Source = Analog4, 43 | SourceRange = InputControlMapping.Range.Negative, 44 | TargetRange = InputControlMapping.Range.Negative, 45 | Invert = true 46 | }, 47 | new InputControlMapping { 48 | Handle = "DPad Right", 49 | Target = InputControlType.DPadRight, 50 | Source = Analog4, 51 | SourceRange = InputControlMapping.Range.Positive, 52 | TargetRange = InputControlMapping.Range.Positive 53 | }, 54 | new InputControlMapping { 55 | Handle = "DPad Up", 56 | Target = InputControlType.DPadUp, 57 | Source = Analog5, 58 | SourceRange = InputControlMapping.Range.Negative, 59 | TargetRange = InputControlMapping.Range.Negative, 60 | Invert = true 61 | }, 62 | new InputControlMapping { 63 | Handle = "DPad Down", 64 | Target = InputControlType.DPadDown, 65 | Source = Analog5, 66 | SourceRange = InputControlMapping.Range.Positive, 67 | TargetRange = InputControlMapping.Range.Positive, 68 | } 69 | }; 70 | } 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AmazonFireTVRemoteProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80ad4e35aa78842e58a40b54d6fa4660 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AndroidTVProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // Tested with ADT-1 7 | // Profile by Artūras 'arturaz' Šlajus 8 | // 9 | // @cond nodoc 10 | [AutoDiscover] 11 | public class AndroidTVProfile : UnityInputDeviceProfile 12 | { 13 | public AndroidTVProfile() 14 | { 15 | Name = "Android TV Controller"; 16 | Meta = "Android TV Controller on Android TV"; 17 | 18 | SupportedPlatforms = new[] { 19 | "Android" 20 | }; 21 | 22 | JoystickNames = new[] { 23 | "Gamepad" 24 | }; 25 | 26 | ButtonMappings = new[] { 27 | new InputControlMapping { 28 | Handle = "A", 29 | Target = InputControlType.Action1, 30 | Source = Button0 31 | }, 32 | new InputControlMapping { 33 | Handle = "B", 34 | Target = InputControlType.Action2, 35 | Source = Button1 36 | }, 37 | new InputControlMapping { 38 | Handle = "X", 39 | Target = InputControlType.Action3, 40 | Source = Button2 41 | }, 42 | new InputControlMapping { 43 | Handle = "Y", 44 | Target = InputControlType.Action4, 45 | Source = Button3 46 | }, 47 | new InputControlMapping { 48 | Handle = "Left Bumper", 49 | Target = InputControlType.LeftBumper, 50 | Source = Button4 51 | }, 52 | new InputControlMapping { 53 | Handle = "Right Bumper", 54 | Target = InputControlType.RightBumper, 55 | Source = Button5 56 | }, 57 | new InputControlMapping { 58 | Handle = "Left Stick Button", 59 | Target = InputControlType.LeftStickButton, 60 | Source = Button8 61 | }, 62 | new InputControlMapping { 63 | Handle = "Right Stick Button", 64 | Target = InputControlType.RightStickButton, 65 | Source = Button9 66 | } 67 | }; 68 | 69 | AnalogMappings = new[] { 70 | new InputControlMapping { 71 | Handle = "Left Stick X", 72 | Target = InputControlType.LeftStickX, 73 | Source = Analog0 74 | }, 75 | new InputControlMapping { 76 | Handle = "Left Stick Y", 77 | Target = InputControlType.LeftStickY, 78 | Source = Analog1, 79 | Invert = true 80 | }, 81 | new InputControlMapping { 82 | Handle = "Right Stick X", 83 | Target = InputControlType.RightStickX, 84 | Source = Analog2 85 | }, 86 | new InputControlMapping { 87 | Handle = "Right Stick Y", 88 | Target = InputControlType.RightStickY, 89 | Source = Analog3, 90 | Invert = true 91 | }, 92 | new InputControlMapping { 93 | Handle = "DPad Left", 94 | Target = InputControlType.DPadLeft, 95 | Source = Analog4, 96 | SourceRange = InputControlMapping.Range.Negative, 97 | TargetRange = InputControlMapping.Range.Negative, 98 | Invert = true 99 | }, 100 | new InputControlMapping { 101 | Handle = "DPad Right", 102 | Target = InputControlType.DPadRight, 103 | Source = Analog4, 104 | SourceRange = InputControlMapping.Range.Positive, 105 | TargetRange = InputControlMapping.Range.Positive 106 | }, 107 | new InputControlMapping { 108 | Handle = "DPad Up", 109 | Target = InputControlType.DPadUp, 110 | Source = Analog5, 111 | SourceRange = InputControlMapping.Range.Negative, 112 | TargetRange = InputControlMapping.Range.Negative 113 | }, 114 | new InputControlMapping { 115 | Handle = "DPad Down", 116 | Target = InputControlType.DPadDown, 117 | Source = Analog5, 118 | SourceRange = InputControlMapping.Range.Positive, 119 | TargetRange = InputControlMapping.Range.Positive, 120 | Invert = true 121 | }, 122 | new InputControlMapping { 123 | Handle = "Left Trigger", 124 | Target = InputControlType.LeftTrigger, 125 | Source = Analog6 126 | }, 127 | new InputControlMapping { 128 | Handle = "Right Trigger", 129 | Target = InputControlType.RightTrigger, 130 | Source = Analog7 131 | }, 132 | }; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AndroidTVProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54d2ec3308b484f8c9231d1eb0f291f6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AndroidTVRemoteProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // Tested with ADT-1 7 | // Profile by Artūras 'arturaz' Šlajus 8 | // 9 | // @cond nodoc 10 | [AutoDiscover] 11 | public class AndroidTVRemoteProfile : UnityInputDeviceProfile 12 | { 13 | public AndroidTVRemoteProfile() 14 | { 15 | Name = "Android TV Remote"; 16 | Meta = "Android TV Remotet on Android TV"; 17 | 18 | SupportedPlatforms = new[] { 19 | "Android" 20 | }; 21 | 22 | JoystickNames = new[] { 23 | "touch-input", 24 | "navigation-input" 25 | }; 26 | 27 | ButtonMappings = new[] { 28 | new InputControlMapping { 29 | Handle = "A", 30 | Target = InputControlType.Action1, 31 | Source = Button0 32 | } 33 | }; 34 | 35 | AnalogMappings = new[] { 36 | new InputControlMapping { 37 | Handle = "DPad Left", 38 | Target = InputControlType.DPadLeft, 39 | Source = Analog4, 40 | SourceRange = InputControlMapping.Range.Negative, 41 | TargetRange = InputControlMapping.Range.Negative, 42 | Invert = true 43 | }, 44 | new InputControlMapping { 45 | Handle = "DPad Right", 46 | Target = InputControlType.DPadRight, 47 | Source = Analog4, 48 | SourceRange = InputControlMapping.Range.Positive, 49 | TargetRange = InputControlMapping.Range.Positive 50 | }, 51 | new InputControlMapping { 52 | Handle = "DPad Up", 53 | Target = InputControlType.DPadUp, 54 | Source = Analog5, 55 | SourceRange = InputControlMapping.Range.Negative, 56 | TargetRange = InputControlMapping.Range.Negative 57 | }, 58 | new InputControlMapping { 59 | Handle = "DPad Down", 60 | Target = InputControlType.DPadDown, 61 | Source = Analog5, 62 | SourceRange = InputControlMapping.Range.Positive, 63 | TargetRange = InputControlMapping.Range.Positive, 64 | Invert = true 65 | }, 66 | }; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AndroidTVRemoteProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2780272058d174cb69990315a2089ba5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AppleMFiProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class AppleMFiProfile : UnityInputDeviceProfile 9 | { 10 | public AppleMFiProfile() 11 | { 12 | Name = "Apple MFi Controller"; 13 | Meta = "Apple MFi Controller on iOS"; 14 | 15 | SupportedPlatforms = new[] { 16 | "iPhone" 17 | }; 18 | 19 | LastResortRegex = ""; // Match anything. 20 | 21 | LowerDeadZone = 0.05f; 22 | UpperDeadZone = 0.95f; 23 | 24 | ButtonMappings = new[] { 25 | new InputControlMapping { 26 | Handle = "A", 27 | Target = InputControlType.Action1, 28 | Source = Button14 29 | }, 30 | new InputControlMapping { 31 | Handle = "B", 32 | Target = InputControlType.Action2, 33 | Source = Button13 34 | }, 35 | new InputControlMapping { 36 | Handle = "X", 37 | Target = InputControlType.Action3, 38 | Source = Button15 39 | }, 40 | new InputControlMapping { 41 | Handle = "Y", 42 | Target = InputControlType.Action4, 43 | Source = Button12 44 | }, 45 | new InputControlMapping { 46 | Handle = "DPad Up", 47 | Target = InputControlType.DPadUp, 48 | Source = Button4 49 | }, 50 | new InputControlMapping { 51 | Handle = "DPad Down", 52 | Target = InputControlType.DPadDown, 53 | Source = Button6 54 | }, 55 | new InputControlMapping { 56 | Handle = "DPad Left", 57 | Target = InputControlType.DPadLeft, 58 | Source = Button7 59 | }, 60 | new InputControlMapping { 61 | Handle = "DPad Right", 62 | Target = InputControlType.DPadRight, 63 | Source = Button5 64 | }, 65 | new InputControlMapping { 66 | Handle = "Left Bumper", 67 | Target = InputControlType.LeftBumper, 68 | Source = Button8 69 | }, 70 | new InputControlMapping { 71 | Handle = "Right Bumper", 72 | Target = InputControlType.RightBumper, 73 | Source = Button9 74 | }, 75 | new InputControlMapping { 76 | Handle = "Pause", 77 | Target = InputControlType.Pause, 78 | Source = Button0 79 | }, 80 | new InputControlMapping { 81 | Handle = "Left Trigger", 82 | Target = InputControlType.LeftTrigger, 83 | Source = Button10 84 | }, 85 | new InputControlMapping { 86 | Handle = "Right Trigger", 87 | Target = InputControlType.RightTrigger, 88 | Source = Button11 89 | } 90 | }; 91 | 92 | AnalogMappings = new[] { 93 | new InputControlMapping { 94 | Handle = "Left Stick X", 95 | Target = InputControlType.LeftStickX, 96 | Source = Analog0 97 | }, 98 | new InputControlMapping { 99 | Handle = "Left Stick Y", 100 | Target = InputControlType.LeftStickY, 101 | Source = Analog1, 102 | Invert = true 103 | }, 104 | new InputControlMapping { 105 | Handle = "Right Stick X", 106 | Target = InputControlType.RightStickX, 107 | Source = Analog2 108 | }, 109 | new InputControlMapping { 110 | Handle = "Right Stick Y", 111 | Target = InputControlType.RightStickY, 112 | Source = Analog3, 113 | Invert = true 114 | } 115 | }; 116 | } 117 | } 118 | } 119 | 120 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/AppleMFiProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c89260f1a809240da93263417fd69da4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/ExecutionerXProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42ec64635f5114355ba3cdb475542c7e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GameStickLinuxProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class GameStickLinuxProfile : UnityInputDeviceProfile 9 | { 10 | public GameStickLinuxProfile() 11 | { 12 | Name = "GameStick Controller"; 13 | Meta = "GameStick Controller on Linux"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Linux" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "GameStick Controller" 21 | }; 22 | 23 | MaxUnityVersion = new VersionInfo( 4, 9 ); 24 | 25 | ButtonMappings = new[] { 26 | new InputControlMapping { 27 | Handle = "A", 28 | Target = InputControlType.Action1, 29 | Source = Button0 30 | }, 31 | new InputControlMapping { 32 | Handle = "B", 33 | Target = InputControlType.Action2, 34 | Source = Button1 35 | }, 36 | new InputControlMapping { 37 | Handle = "X", 38 | Target = InputControlType.Action3, 39 | Source = Button3 40 | }, 41 | new InputControlMapping { 42 | Handle = "Y", 43 | Target = InputControlType.Action4, 44 | Source = Button4 45 | }, 46 | new InputControlMapping { 47 | Handle = "Left Bumper", 48 | Target = InputControlType.LeftBumper, 49 | Source = Button6 50 | }, 51 | new InputControlMapping { 52 | Handle = "Right Bumper", 53 | Target = InputControlType.RightBumper, 54 | Source = Button7 55 | }, 56 | new InputControlMapping { 57 | Handle = "Left Stick Button", 58 | Target = InputControlType.LeftStickButton, 59 | Source = Button13 60 | }, 61 | new InputControlMapping { 62 | Handle = "Right Stick Button", 63 | Target = InputControlType.RightStickButton, 64 | Source = Button14 65 | }, 66 | new InputControlMapping { 67 | Handle = "Start", 68 | Target = InputControlType.Start, 69 | Source = Button11 70 | } 71 | }; 72 | 73 | AnalogMappings = new[] { 74 | new InputControlMapping { 75 | Handle = "Left Stick X", 76 | Target = InputControlType.LeftStickX, 77 | Source = Analog0 78 | }, 79 | new InputControlMapping { 80 | Handle = "Left Stick Y", 81 | Target = InputControlType.LeftStickY, 82 | Source = Analog1, 83 | Invert = true 84 | }, 85 | new InputControlMapping { 86 | Handle = "Right Stick X", 87 | Target = InputControlType.RightStickX, 88 | Source = Analog2 89 | }, 90 | new InputControlMapping { 91 | Handle = "Right Stick Y", 92 | Target = InputControlType.RightStickY, 93 | Source = Analog3, 94 | Invert = true 95 | }, 96 | new InputControlMapping { 97 | Handle = "DPad Left", 98 | Target = InputControlType.DPadLeft, 99 | Source = Analog6, 100 | SourceRange = InputControlMapping.Range.Negative, 101 | TargetRange = InputControlMapping.Range.Negative, 102 | Invert = true 103 | }, 104 | new InputControlMapping { 105 | Handle = "DPad Right", 106 | Target = InputControlType.DPadRight, 107 | Source = Analog6, 108 | SourceRange = InputControlMapping.Range.Positive, 109 | TargetRange = InputControlMapping.Range.Positive 110 | }, 111 | new InputControlMapping { 112 | Handle = "DPad Up", 113 | Target = InputControlType.DPadUp, 114 | Source = Analog7, 115 | SourceRange = InputControlMapping.Range.Negative, 116 | TargetRange = InputControlMapping.Range.Negative, 117 | Invert = true 118 | }, 119 | new InputControlMapping { 120 | Handle = "DPad Down", 121 | Target = InputControlType.DPadDown, 122 | Source = Analog7, 123 | SourceRange = InputControlMapping.Range.Positive, 124 | TargetRange = InputControlMapping.Range.Positive 125 | }, 126 | }; 127 | } 128 | } 129 | } 130 | 131 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GameStickLinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d68013e94a92d42bd846a742809769e4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GameStickProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class GameStickProfile : UnityInputDeviceProfile 9 | { 10 | public GameStickProfile() 11 | { 12 | Name = "GameStick Controller"; 13 | Meta = "GameStick Controller on GameStick"; 14 | 15 | SupportedPlatforms = new[] { 16 | "GameStick" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "GameStick Controller 1", 21 | "GameStick Controller 2", 22 | "GameStick Controller 3", 23 | "GameStick Controller 4" 24 | }; 25 | 26 | ButtonMappings = new[] { 27 | new InputControlMapping { 28 | Handle = "A", 29 | Target = InputControlType.Action1, 30 | Source = Button0 31 | }, 32 | new InputControlMapping { 33 | Handle = "B", 34 | Target = InputControlType.Action2, 35 | Source = Button1 36 | }, 37 | new InputControlMapping { 38 | Handle = "X", 39 | Target = InputControlType.Action3, 40 | Source = Button2 41 | }, 42 | new InputControlMapping { 43 | Handle = "Y", 44 | Target = InputControlType.Action4, 45 | Source = Button3 46 | }, 47 | new InputControlMapping { 48 | Handle = "Left Bumper", 49 | Target = InputControlType.LeftBumper, 50 | Source = Button4 51 | }, 52 | new InputControlMapping { 53 | Handle = "Right Bumper", 54 | Target = InputControlType.RightBumper, 55 | Source = Button5 56 | }, 57 | new InputControlMapping { 58 | Handle = "Left Stick Button", 59 | Target = InputControlType.LeftStickButton, 60 | Source = Button8 61 | }, 62 | new InputControlMapping { 63 | Handle = "Right Stick Button", 64 | Target = InputControlType.RightStickButton, 65 | Source = Button9 66 | }, 67 | new InputControlMapping { 68 | Handle = "Start", 69 | Target = InputControlType.Start, 70 | Source = Button10 71 | } 72 | }; 73 | 74 | AnalogMappings = new[] { 75 | new InputControlMapping { 76 | Handle = "Left Stick X", 77 | Target = InputControlType.LeftStickX, 78 | Source = Analog0 79 | }, 80 | new InputControlMapping { 81 | Handle = "Left Stick Y", 82 | Target = InputControlType.LeftStickY, 83 | Source = Analog1, 84 | Invert = true 85 | }, 86 | new InputControlMapping { 87 | Handle = "Right Stick X", 88 | Target = InputControlType.RightStickX, 89 | Source = Analog2 90 | }, 91 | new InputControlMapping { 92 | Handle = "Right Stick Y", 93 | Target = InputControlType.RightStickY, 94 | Source = Analog3, 95 | Invert = true 96 | }, 97 | new InputControlMapping { 98 | Handle = "DPad Left", 99 | Target = InputControlType.DPadLeft, 100 | Source = Analog4, 101 | SourceRange = InputControlMapping.Range.Negative, 102 | TargetRange = InputControlMapping.Range.Negative, 103 | Invert = true 104 | }, 105 | new InputControlMapping { 106 | Handle = "DPad Right", 107 | Target = InputControlType.DPadRight, 108 | Source = Analog4, 109 | SourceRange = InputControlMapping.Range.Positive, 110 | TargetRange = InputControlMapping.Range.Positive 111 | }, 112 | new InputControlMapping { 113 | Handle = "DPad Up", 114 | Target = InputControlType.DPadUp, 115 | Source = Analog5, 116 | SourceRange = InputControlMapping.Range.Negative, 117 | TargetRange = InputControlMapping.Range.Negative, 118 | Invert = true 119 | }, 120 | new InputControlMapping { 121 | Handle = "DPad Down", 122 | Target = InputControlType.DPadDown, 123 | Source = Analog5, 124 | SourceRange = InputControlMapping.Range.Positive, 125 | TargetRange = InputControlMapping.Range.Positive 126 | }, 127 | }; 128 | } 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GameStickProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b82340723690943c29aa2be77990d1e5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GenericAndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8bcb7b2354dc4dd8b9ff7d594501f85 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GenericBlackberryProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c9dda98a43b14bff871df4350a82673 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GenericLinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3cafd54facc94cbcafc6eafb171ba4d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GoogleNexusPlayerProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4575b46cd2f0a424ba2e8205c5c9e9db 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GoogleNexusPlayerRemoteProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | [AutoDiscover] 7 | public class GoogleNexusPlayerRemoteProfile : UnityInputDeviceProfile 8 | { 9 | public GoogleNexusPlayerRemoteProfile() 10 | { 11 | Name = "Google Nexus Player Remote"; 12 | Meta = "Google Nexus Player Remote"; 13 | 14 | SupportedPlatforms = new[] { 15 | "Android" 16 | }; 17 | 18 | JoystickNames = new[] { 19 | "Google Nexus Remote" 20 | }; 21 | 22 | ButtonMappings = new[] { 23 | new InputControlMapping { 24 | Handle = "A", 25 | Target = InputControlType.Action1, 26 | Source = Button0 27 | }, 28 | new InputControlMapping { 29 | Handle = "Back", 30 | Target = InputControlType.Back, 31 | Source = KeyCodeButton( UnityEngine.KeyCode.Escape ) 32 | } 33 | }; 34 | 35 | AnalogMappings = new[] { 36 | new InputControlMapping { 37 | Handle = "DPad Left", 38 | Target = InputControlType.DPadLeft, 39 | Source = Analog4, 40 | SourceRange = InputControlMapping.Range.Negative, 41 | TargetRange = InputControlMapping.Range.Negative, 42 | Invert = true 43 | }, 44 | new InputControlMapping { 45 | Handle = "DPad Right", 46 | Target = InputControlType.DPadRight, 47 | Source = Analog4, 48 | SourceRange = InputControlMapping.Range.Positive, 49 | TargetRange = InputControlMapping.Range.Positive 50 | }, 51 | new InputControlMapping { 52 | Handle = "DPad Up", 53 | Target = InputControlType.DPadUp, 54 | Source = Analog5, 55 | SourceRange = InputControlMapping.Range.Negative, 56 | TargetRange = InputControlMapping.Range.Negative, 57 | Invert = true 58 | }, 59 | new InputControlMapping { 60 | Handle = "DPad Down", 61 | Target = InputControlType.DPadDown, 62 | Source = Analog5, 63 | SourceRange = InputControlMapping.Range.Positive, 64 | TargetRange = InputControlMapping.Range.Positive 65 | }, 66 | }; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GoogleNexusPlayerRemoteProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 906f82f3a10354d4b9246b83a70ad4f4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/GreenThrottleAtlasAndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0e4290683ffa4933b5e3647c3efccca 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/HamaBlackForceWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9102d4af6163548298824732695f103f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01bb39d8958ad4feaa2a70545ac2d9f7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeDMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 060c4af5275694a398999bd8c7aa86e5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeDWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 876470a578a335a4c91a3f26292be86a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeXMacProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class LogitechF310ModeXMacProfile : UnityInputDeviceProfile 9 | { 10 | public LogitechF310ModeXMacProfile() 11 | { 12 | Name = "Logitech F310 Controller"; 13 | Meta = "Logitech F310 Controller on Mac (Mode X)"; 14 | 15 | SupportedPlatforms = new[] { 16 | "OS X" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Logitech Gamepad F310" 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "A", 26 | Target = InputControlType.Action1, 27 | Source = Button16 28 | }, 29 | new InputControlMapping { 30 | Handle = "B", 31 | Target = InputControlType.Action2, 32 | Source = Button17 33 | }, 34 | new InputControlMapping { 35 | Handle = "X", 36 | Target = InputControlType.Action3, 37 | Source = Button18 38 | }, 39 | new InputControlMapping { 40 | Handle = "Y", 41 | Target = InputControlType.Action4, 42 | Source = Button19 43 | }, 44 | new InputControlMapping { 45 | Handle = "DPad Up", 46 | Target = InputControlType.DPadUp, 47 | Source = Button5 48 | }, 49 | new InputControlMapping { 50 | Handle = "DPad Down", 51 | Target = InputControlType.DPadDown, 52 | Source = Button6 53 | }, 54 | new InputControlMapping { 55 | Handle = "DPad Left", 56 | Target = InputControlType.DPadLeft, 57 | Source = Button7 58 | }, 59 | new InputControlMapping { 60 | Handle = "DPad Right", 61 | Target = InputControlType.DPadRight, 62 | Source = Button8 63 | }, 64 | new InputControlMapping { 65 | Handle = "Left Bumper", 66 | Target = InputControlType.LeftBumper, 67 | Source = Button13 68 | }, 69 | new InputControlMapping { 70 | Handle = "Right Bumper", 71 | Target = InputControlType.RightBumper, 72 | Source = Button14 73 | }, 74 | new InputControlMapping { 75 | Handle = "Left Stick Button", 76 | Target = InputControlType.LeftStickButton, 77 | Source = Button11 78 | }, 79 | new InputControlMapping { 80 | Handle = "Right Stick Button", 81 | Target = InputControlType.RightStickButton, 82 | Source = Button12 83 | }, 84 | new InputControlMapping { 85 | Handle = "Start", 86 | Target = InputControlType.Start, 87 | Source = Button9 88 | }, 89 | new InputControlMapping { 90 | Handle = "Back", 91 | Target = InputControlType.Select, 92 | Source = Button10 93 | }, 94 | new InputControlMapping { 95 | Handle = "System", 96 | Target = InputControlType.System, 97 | Source = Button15 98 | } 99 | }; 100 | 101 | AnalogMappings = new[] { 102 | new InputControlMapping { 103 | Handle = "Left Stick X", 104 | Target = InputControlType.LeftStickX, 105 | Source = Analog0 106 | }, 107 | new InputControlMapping { 108 | Handle = "Left Stick Y", 109 | Target = InputControlType.LeftStickY, 110 | Source = Analog1, 111 | Invert = true 112 | }, 113 | new InputControlMapping { 114 | Handle = "Right Stick X", 115 | Target = InputControlType.RightStickX, 116 | Source = Analog2 117 | }, 118 | new InputControlMapping { 119 | Handle = "Right Stick Y", 120 | Target = InputControlType.RightStickY, 121 | Source = Analog3, 122 | Invert = true 123 | }, 124 | new InputControlMapping { 125 | Handle = "Left Trigger", 126 | Target = InputControlType.LeftTrigger, 127 | Source = Analog4, 128 | TargetRange = InputControlMapping.Range.Positive, 129 | IgnoreInitialZeroValue = true 130 | }, 131 | new InputControlMapping { 132 | Handle = "Right Trigger", 133 | Target = InputControlType.RightTrigger, 134 | Source = Analog5, 135 | TargetRange = InputControlMapping.Range.Positive, 136 | IgnoreInitialZeroValue = true 137 | } 138 | }; 139 | } 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeXMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d91e1ac4eb9c40649b1f75903351a2b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeXWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3790a7f5feb26c943a2915ff29fa0b06 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF510LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a180fabb46b1a4b8d97d73e711e1f206 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF510WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a1c2b99190d54bceba287401e0fc0c3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF710LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3f7f45c5ea99460b9282815be5dbdf3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF710MacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 772fce0c29f3e4c59a7d6c1dad7402fc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF710ModeDWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f529a5b5e2df484cac96f684d8e3a8c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechF710ModeXWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88159174d7db7444ea4f29c7fff0182e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechRumblePad2MacProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class LogitechRumblePad2MacProfile : UnityInputDeviceProfile 9 | { 10 | public LogitechRumblePad2MacProfile() 11 | { 12 | Name = "Logitech RumblePad 2 Controller"; 13 | Meta = "Logitech RumblePad 2 on Mac"; 14 | 15 | SupportedPlatforms = new[] { 16 | "OS X" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Logitech Logitech RumblePad 2 USB" 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "1", 26 | Target = InputControlType.Action3, 27 | Source = Button0 28 | }, 29 | new InputControlMapping { 30 | Handle = "2", 31 | Target = InputControlType.Action1, 32 | Source = Button1 33 | }, 34 | new InputControlMapping { 35 | Handle = "3", 36 | Target = InputControlType.Action2, 37 | Source = Button2 38 | }, 39 | new InputControlMapping { 40 | Handle = "4", 41 | Target = InputControlType.Action4, 42 | Source = Button3 43 | }, 44 | new InputControlMapping { 45 | Handle = "10", 46 | Target = InputControlType.Start, 47 | Source = Button10 48 | }, 49 | new InputControlMapping { 50 | Handle = "Left Stick Button", 51 | Target = InputControlType.LeftStickButton, 52 | Source = Button11 53 | }, 54 | new InputControlMapping { 55 | Handle = "Right Stick Button", 56 | Target = InputControlType.RightStickButton, 57 | Source = Button12 58 | }, 59 | new InputControlMapping { 60 | Handle = "Left Bumper", 61 | Target = InputControlType.LeftBumper, 62 | Source = Button4 63 | }, 64 | new InputControlMapping { 65 | Handle = "Right Bumper", 66 | Target = InputControlType.RightBumper, 67 | Source = Button5 68 | }, 69 | new InputControlMapping { 70 | Handle = "Left Trigger", 71 | Target = InputControlType.LeftTrigger, 72 | Source = Button6 73 | }, 74 | new InputControlMapping { 75 | Handle = "Right Trigger", 76 | Target = InputControlType.RightTrigger, 77 | Source = Button7 78 | } 79 | }; 80 | 81 | AnalogMappings = new[] { 82 | new InputControlMapping { 83 | Handle = "Left Stick X", 84 | Target = InputControlType.LeftStickX, 85 | Source = Analog0 86 | }, 87 | new InputControlMapping { 88 | Handle = "Left Stick Y", 89 | Target = InputControlType.LeftStickY, 90 | Source = Analog1, 91 | Invert = true 92 | }, 93 | new InputControlMapping { 94 | Handle = "Right Stick X", 95 | Target = InputControlType.RightStickX, 96 | Source = Analog2 97 | }, 98 | new InputControlMapping { 99 | Handle = "Right Stick Y", 100 | Target = InputControlType.RightStickY, 101 | Source = Analog3, 102 | Invert = true 103 | }, 104 | new InputControlMapping { 105 | Handle = "DPad Left", 106 | Target = InputControlType.DPadLeft, 107 | Source = Analog4, 108 | Invert = true 109 | }, 110 | new InputControlMapping { 111 | Handle = "DPad Right", 112 | Target = InputControlType.DPadRight, 113 | Source = Analog4 114 | 115 | }, 116 | new InputControlMapping { 117 | Handle = "DPad Up", 118 | Target = InputControlType.DPadUp, 119 | Source = Analog5, 120 | Invert = true 121 | }, 122 | new InputControlMapping { 123 | Handle = "DPad Down", 124 | Target = InputControlType.DPadDown, 125 | Source = Analog5 126 | }, 127 | }; 128 | } 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechRumblePad2MacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82a6436b4a1c64491b4f894a10b9ecc8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechRumblePad2WinProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class LogitechRumblePad2WinProfile : UnityInputDeviceProfile 9 | { 10 | public LogitechRumblePad2WinProfile() 11 | { 12 | Name = "Logitech RumblePad 2 Controller"; 13 | Meta = "Logitech RumblePad 2 Controller on Windows"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Windows" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Logitech Rumblepad 2 USB" 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "1", 26 | Target = InputControlType.Action3, 27 | Source = Button0 28 | }, 29 | new InputControlMapping { 30 | Handle = "2", 31 | Target = InputControlType.Action1, 32 | Source = Button1 33 | }, 34 | new InputControlMapping { 35 | Handle = "3", 36 | Target = InputControlType.Action2, 37 | Source = Button2 38 | }, 39 | new InputControlMapping { 40 | Handle = "4", 41 | Target = InputControlType.Action4, 42 | Source = Button3 43 | }, 44 | new InputControlMapping { 45 | Handle = "9", 46 | Target = InputControlType.Back, 47 | Source = Button8 48 | }, 49 | new InputControlMapping { 50 | Handle = "10", 51 | Target = InputControlType.Start, 52 | Source = Button9 53 | }, 54 | new InputControlMapping { 55 | Handle = "Left Stick Button", 56 | Target = InputControlType.LeftStickButton, 57 | Source = Button11 58 | }, 59 | new InputControlMapping { 60 | Handle = "Right Stick Button", 61 | Target = InputControlType.RightStickButton, 62 | Source = Button12 63 | }, 64 | new InputControlMapping { 65 | Handle = "Left Bumper", 66 | Target = InputControlType.LeftBumper, 67 | Source = Button4 68 | }, 69 | new InputControlMapping { 70 | Handle = "Right Bumper", 71 | Target = InputControlType.RightBumper, 72 | Source = Button5 73 | }, 74 | new InputControlMapping { 75 | Handle = "Left Trigger", 76 | Target = InputControlType.LeftTrigger, 77 | Source = Button6 78 | }, 79 | new InputControlMapping { 80 | Handle = "Right Trigger", 81 | Target = InputControlType.RightTrigger, 82 | Source = Button7 83 | } 84 | }; 85 | 86 | AnalogMappings = new[] { 87 | new InputControlMapping { 88 | Handle = "Left Stick X", 89 | Target = InputControlType.LeftStickX, 90 | Source = Analog0 91 | }, 92 | new InputControlMapping { 93 | Handle = "Left Stick Y", 94 | Target = InputControlType.LeftStickY, 95 | Source = Analog1, 96 | Invert = true 97 | }, 98 | new InputControlMapping { 99 | Handle = "Right Stick X", 100 | Target = InputControlType.RightStickX, 101 | Source = Analog2 102 | }, 103 | new InputControlMapping { 104 | Handle = "Right Stick Y", 105 | Target = InputControlType.RightStickY, 106 | Source = Analog3, 107 | Invert = true 108 | }, 109 | new InputControlMapping { 110 | Handle = "DPad Left", 111 | Target = InputControlType.DPadLeft, 112 | Source = Analog4, 113 | Invert = true 114 | }, 115 | new InputControlMapping { 116 | Handle = "DPad Right", 117 | Target = InputControlType.DPadRight, 118 | Source = Analog4 119 | 120 | }, 121 | new InputControlMapping { 122 | Handle = "DPad Up", 123 | Target = InputControlType.DPadUp, 124 | Source = Analog5, 125 | Invert = true 126 | }, 127 | new InputControlMapping { 128 | Handle = "DPad Down", 129 | Target = InputControlType.DPadDown, 130 | Source = Analog5 131 | }, 132 | }; 133 | } 134 | } 135 | } 136 | 137 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechRumblePad2WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 193d4b539b46e490b9c600e01dfb7861 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/LogitechWingManWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c36d04b711976475d9b17eb06a880cf4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/MaxFireBlaze5WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e47c7f7394625444e84e88ad1cb06f8a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/MogaProLinuxProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class MogaProLinuxProfile : UnityInputDeviceProfile 9 | { 10 | public MogaProLinuxProfile() 11 | { 12 | Name = "MOGA Pro"; 13 | Meta = "MOGA Pro on Linux"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Linux", 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Moga Pro HID", 21 | }; 22 | 23 | MaxUnityVersion = new VersionInfo( 4, 9 ); 24 | 25 | ButtonMappings = new[] { 26 | new InputControlMapping { 27 | Handle = "A", 28 | Target = InputControlType.Action1, 29 | Source = Button0 30 | }, 31 | new InputControlMapping { 32 | Handle = "B", 33 | Target = InputControlType.Action2, 34 | Source = Button1 35 | }, 36 | new InputControlMapping { 37 | Handle = "X", 38 | Target = InputControlType.Action3, 39 | Source = Button2 40 | }, 41 | new InputControlMapping { 42 | Handle = "Y", 43 | Target = InputControlType.Action4, 44 | Source = Button3 45 | }, 46 | new InputControlMapping { 47 | Handle = "Left Bumper", 48 | Target = InputControlType.LeftBumper, 49 | Source = Button4 50 | }, 51 | new InputControlMapping { 52 | Handle = "Right Bumper", 53 | Target = InputControlType.RightBumper, 54 | Source = Button5 55 | }, 56 | new InputControlMapping { 57 | Handle = "Left Stick Button", 58 | Target = InputControlType.LeftStickButton, 59 | Source = Button7 60 | }, 61 | new InputControlMapping { 62 | Handle = "Right Stick Button", 63 | Target = InputControlType.RightStickButton, 64 | Source = Button8 65 | }, 66 | new InputControlMapping { 67 | Handle = "Start", 68 | Target = InputControlType.Start, 69 | Source = Button6 70 | } 71 | }; 72 | 73 | AnalogMappings = new[] { 74 | new InputControlMapping { 75 | Handle = "Left Stick X", 76 | Target = InputControlType.LeftStickX, 77 | Source = Analog0, 78 | }, 79 | new InputControlMapping { 80 | Handle = "Left Stick Y", 81 | Target = InputControlType.LeftStickY, 82 | Source = Analog1, 83 | Invert = true 84 | }, 85 | new InputControlMapping { 86 | Handle = "Right Stick X", 87 | Target = InputControlType.RightStickX, 88 | Source = Analog2 89 | }, 90 | new InputControlMapping { 91 | Handle = "Right Stick Y", 92 | Target = InputControlType.RightStickY, 93 | Source = Analog3, 94 | Invert = true 95 | }, 96 | new InputControlMapping { 97 | Handle = "DPad Left", 98 | Target = InputControlType.DPadLeft, 99 | Source = Analog6, 100 | SourceRange = InputControlMapping.Range.Negative, 101 | TargetRange = InputControlMapping.Range.Negative, 102 | Invert = true 103 | }, 104 | new InputControlMapping { 105 | Handle = "DPad Right", 106 | Target = InputControlType.DPadRight, 107 | Source = Analog6, 108 | SourceRange = InputControlMapping.Range.Positive, 109 | TargetRange = InputControlMapping.Range.Positive 110 | }, 111 | new InputControlMapping { 112 | Handle = "DPad Up", 113 | Target = InputControlType.DPadUp, 114 | Source = Analog7, 115 | SourceRange = InputControlMapping.Range.Negative, 116 | TargetRange = InputControlMapping.Range.Negative, 117 | Invert = true 118 | 119 | }, 120 | new InputControlMapping { 121 | Handle = "DPad Down", 122 | Target = InputControlType.DPadDown, 123 | Source = Analog7, 124 | SourceRange = InputControlMapping.Range.Positive, 125 | TargetRange = InputControlMapping.Range.Positive 126 | }, 127 | new InputControlMapping { 128 | Handle = "Left Trigger", 129 | Target = InputControlType.LeftTrigger, 130 | Source = Analog5, 131 | }, 132 | new InputControlMapping { 133 | Handle = "Right Trigger", 134 | Target = InputControlType.RightTrigger, 135 | Source = Analog4 136 | } 137 | }; 138 | } 139 | } 140 | } 141 | 142 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/MogaProLinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42d4d1a8b480b4ac99ecf0a7f6d0639c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/MogaProMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d2bfa46800f942da87f120f421ab2c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/MogaProWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25c66976183c4422dad22c53647d705c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/NVidiaShieldAndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ea369cf9c06d46c38bc190dd56cbc55 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/NVidiaShieldWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41359b875cd8641aea7b21cee87b1b5e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/NatecGenesisP44WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ce4b0d50cf4b40c7ba35bcd189eb813 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/OuyaLinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce1481152bdf34d2386af5fcd9f94477 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/OuyaWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff36a3f030ca5475eb996f03eca2c1b4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation2WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ef4e6024cccd4b7f88ea287b01dd877 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3AndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52cb89bbfa4524354b3b8681fca2c440 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3LinuxProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class PlayStation3LinuxProfile : UnityInputDeviceProfile 9 | { 10 | public PlayStation3LinuxProfile() 11 | { 12 | Name = "PlayStation 3 Controller"; 13 | Meta = "PlayStation 3 Controller on Linux"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Linux" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Sony PLAYSTATION(R)3 Controller", 21 | "SHENGHIC 2009/0708ZXW-V1Inc. PLAYSTATION(R)3Conteroller" // Not a typo. 22 | }; 23 | 24 | MaxUnityVersion = new VersionInfo( 4, 9 ); 25 | 26 | ButtonMappings = new[] { 27 | new InputControlMapping { 28 | Handle = "Cross", 29 | Target = InputControlType.Action1, 30 | Source = Button14 31 | }, 32 | new InputControlMapping { 33 | Handle = "Circle", 34 | Target = InputControlType.Action2, 35 | Source = Button13 36 | }, 37 | new InputControlMapping { 38 | Handle = "Square", 39 | Target = InputControlType.Action3, 40 | Source = Button15 41 | }, 42 | new InputControlMapping { 43 | Handle = "Triangle", 44 | Target = InputControlType.Action4, 45 | Source = Button12 46 | }, 47 | new InputControlMapping { 48 | Handle = "DPad Up", 49 | Target = InputControlType.DPadUp, 50 | Source = Button4 51 | }, 52 | new InputControlMapping { 53 | Handle = "DPad Down", 54 | Target = InputControlType.DPadDown, 55 | Source = Button6 56 | }, 57 | new InputControlMapping { 58 | Handle = "DPad Left", 59 | Target = InputControlType.DPadLeft, 60 | Source = Button7 61 | }, 62 | new InputControlMapping { 63 | Handle = "DPad Right", 64 | Target = InputControlType.DPadRight, 65 | Source = Button5 66 | }, 67 | new InputControlMapping { 68 | Handle = "Left Bumper", 69 | Target = InputControlType.LeftBumper, 70 | Source = Button10 71 | }, 72 | new InputControlMapping { 73 | Handle = "Right Bumper", 74 | Target = InputControlType.RightBumper, 75 | Source = Button11 76 | }, 77 | new InputControlMapping { 78 | Handle = "Start", 79 | Target = InputControlType.Start, 80 | Source = Button3 81 | }, 82 | new InputControlMapping { 83 | Handle = "Select", 84 | Target = InputControlType.Select, 85 | Source = Button0 86 | }, 87 | new InputControlMapping { 88 | Handle = "Left Trigger", 89 | Target = InputControlType.LeftTrigger, 90 | Source = Button8 91 | }, 92 | new InputControlMapping { 93 | Handle = "Right Trigger", 94 | Target = InputControlType.RightTrigger, 95 | Source = Button9 96 | }, 97 | new InputControlMapping { 98 | Handle = "Left Stick Button", 99 | Target = InputControlType.LeftStickButton, 100 | Source = Button1 101 | }, 102 | new InputControlMapping { 103 | Handle = "Right Stick Button", 104 | Target = InputControlType.RightStickButton, 105 | Source = Button2 106 | }, 107 | new InputControlMapping { 108 | Handle = "System", 109 | Target = InputControlType.System, 110 | Source = Button16 111 | } 112 | }; 113 | 114 | AnalogMappings = new[] { 115 | new InputControlMapping { 116 | Handle = "Left Stick X", 117 | Target = InputControlType.LeftStickX, 118 | Source = Analog0 119 | }, 120 | new InputControlMapping { 121 | Handle = "Left Stick Y", 122 | Target = InputControlType.LeftStickY, 123 | Source = Analog1, 124 | Invert = true 125 | }, 126 | new InputControlMapping { 127 | Handle = "Right Stick X", 128 | Target = InputControlType.RightStickX, 129 | Source = Analog2 130 | }, 131 | new InputControlMapping { 132 | Handle = "Right Stick Y", 133 | Target = InputControlType.RightStickY, 134 | Source = Analog3, 135 | Invert = true 136 | } 137 | }; 138 | } 139 | } 140 | } 141 | 142 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 362efd5e82cbb487fb63146b39f0e2d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3MacProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class PlayStation3MacProfile : UnityInputDeviceProfile 9 | { 10 | public PlayStation3MacProfile() 11 | { 12 | Name = "PlayStation 3 Controller"; 13 | Meta = "PlayStation 3 Controller on Mac"; 14 | 15 | SupportedPlatforms = new[] { 16 | "OS X" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Sony PLAYSTATION(R)3 Controller", 21 | "SHENGHIC 2009/0708ZXW-V1Inc. PLAYSTATION(R)3Conteroller" // Works in editor, not in player? 22 | }; 23 | 24 | ButtonMappings = new[] { 25 | new InputControlMapping { 26 | Handle = "Cross", 27 | Target = InputControlType.Action1, 28 | Source = Button14 29 | }, 30 | new InputControlMapping { 31 | Handle = "Circle", 32 | Target = InputControlType.Action2, 33 | Source = Button13 34 | }, 35 | new InputControlMapping { 36 | Handle = "Square", 37 | Target = InputControlType.Action3, 38 | Source = Button15 39 | }, 40 | new InputControlMapping { 41 | Handle = "Triangle", 42 | Target = InputControlType.Action4, 43 | Source = Button12 44 | }, 45 | new InputControlMapping { 46 | Handle = "DPad Up", 47 | Target = InputControlType.DPadUp, 48 | Source = Button4 49 | }, 50 | new InputControlMapping { 51 | Handle = "DPad Down", 52 | Target = InputControlType.DPadDown, 53 | Source = Button6 54 | }, 55 | new InputControlMapping { 56 | Handle = "DPad Left", 57 | Target = InputControlType.DPadLeft, 58 | Source = Button7 59 | }, 60 | new InputControlMapping { 61 | Handle = "DPad Right", 62 | Target = InputControlType.DPadRight, 63 | Source = Button5 64 | }, 65 | new InputControlMapping { 66 | Handle = "Left Bumper", 67 | Target = InputControlType.LeftBumper, 68 | Source = Button10 69 | }, 70 | new InputControlMapping { 71 | Handle = "Right Bumper", 72 | Target = InputControlType.RightBumper, 73 | Source = Button11 74 | }, 75 | new InputControlMapping { 76 | Handle = "Start", 77 | Target = InputControlType.Start, 78 | Source = Button3 79 | }, 80 | new InputControlMapping { 81 | Handle = "Select", 82 | Target = InputControlType.Select, 83 | Source = Button0 84 | }, 85 | new InputControlMapping { 86 | Handle = "Left Trigger", 87 | Target = InputControlType.LeftTrigger, 88 | Source = Button8 89 | }, 90 | new InputControlMapping { 91 | Handle = "Right Trigger", 92 | Target = InputControlType.RightTrigger, 93 | Source = Button9 94 | }, 95 | new InputControlMapping { 96 | Handle = "Left Stick Button", 97 | Target = InputControlType.LeftStickButton, 98 | Source = Button1 99 | }, 100 | new InputControlMapping { 101 | Handle = "Right Stick Button", 102 | Target = InputControlType.RightStickButton, 103 | Source = Button2 104 | }, 105 | new InputControlMapping { 106 | Handle = "System", 107 | Target = InputControlType.System, 108 | Source = Button16 109 | }, 110 | }; 111 | 112 | AnalogMappings = new[] { 113 | new InputControlMapping { 114 | Handle = "Left Stick X", 115 | Target = InputControlType.LeftStickX, 116 | Source = Analog0 117 | }, 118 | new InputControlMapping { 119 | Handle = "Left Stick Y", 120 | Target = InputControlType.LeftStickY, 121 | Source = Analog1, 122 | Invert = true 123 | }, 124 | new InputControlMapping { 125 | Handle = "Right Stick X", 126 | Target = InputControlType.RightStickX, 127 | Source = Analog2 128 | }, 129 | new InputControlMapping { 130 | Handle = "Right Stick Y", 131 | Target = InputControlType.RightStickY, 132 | Source = Analog3, 133 | Invert = true 134 | } 135 | }; 136 | } 137 | } 138 | } 139 | 140 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3MacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40e804e59de9c4248aa158509ae39cbd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3ShenghicWinProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class PlayStation3ShenghicWinProfile : UnityInputDeviceProfile 9 | { 10 | public PlayStation3ShenghicWinProfile() 11 | { 12 | Name = "PlayStation 3 Controller"; 13 | Meta = "Shenghic PlayStation 3 Controller on Windows (not MotionInJoy)"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Windows" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "PLAYSTATION(R)3Conteroller" // Not a typo. 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "Cross", 26 | Target = InputControlType.Action1, 27 | Source = Button14 28 | }, 29 | new InputControlMapping { 30 | Handle = "Circle", 31 | Target = InputControlType.Action2, 32 | Source = Button13 33 | }, 34 | new InputControlMapping { 35 | Handle = "Square", 36 | Target = InputControlType.Action3, 37 | Source = Button15 38 | }, 39 | new InputControlMapping { 40 | Handle = "Triangle", 41 | Target = InputControlType.Action4, 42 | Source = Button12 43 | }, 44 | new InputControlMapping { 45 | Handle = "DPad Up", 46 | Target = InputControlType.DPadUp, 47 | Source = Button4 48 | }, 49 | new InputControlMapping { 50 | Handle = "DPad Down", 51 | Target = InputControlType.DPadDown, 52 | Source = Button6 53 | }, 54 | new InputControlMapping { 55 | Handle = "DPad Left", 56 | Target = InputControlType.DPadLeft, 57 | Source = Button7 58 | }, 59 | new InputControlMapping { 60 | Handle = "DPad Right", 61 | Target = InputControlType.DPadRight, 62 | Source = Button5 63 | }, 64 | new InputControlMapping { 65 | Handle = "Left Bumper", 66 | Target = InputControlType.LeftBumper, 67 | Source = Button10 68 | }, 69 | new InputControlMapping { 70 | Handle = "Right Bumper", 71 | Target = InputControlType.RightBumper, 72 | Source = Button11 73 | }, 74 | new InputControlMapping { 75 | Handle = "Left Trigger", 76 | Target = InputControlType.LeftTrigger, 77 | Source = Button8 78 | }, 79 | new InputControlMapping { 80 | Handle = "Right Trigger", 81 | Target = InputControlType.RightTrigger, 82 | Source = Button9 83 | }, 84 | new InputControlMapping { 85 | Handle = "Select", 86 | Target = InputControlType.Select, 87 | Source = Button3 88 | }, 89 | new InputControlMapping { 90 | Handle = "Left Stick Button", 91 | Target = InputControlType.LeftStickButton, 92 | Source = Button1 93 | }, 94 | new InputControlMapping { 95 | Handle = "Right Stick Button", 96 | Target = InputControlType.RightStickButton, 97 | Source = Button2 98 | }, 99 | new InputControlMapping { 100 | Handle = "Start", 101 | Target = InputControlType.Start, 102 | Source = Button3 103 | }, 104 | new InputControlMapping { 105 | Handle = "System", 106 | Target = InputControlType.System, 107 | Source = Button16 108 | } 109 | }; 110 | 111 | AnalogMappings = new[] { 112 | new InputControlMapping { 113 | Handle = "Left Stick X", 114 | Target = InputControlType.LeftStickX, 115 | Source = Analog0 116 | }, 117 | new InputControlMapping { 118 | Handle = "Left Stick Y", 119 | Target = InputControlType.LeftStickY, 120 | Source = Analog1, 121 | Invert = true 122 | }, 123 | new InputControlMapping { 124 | Handle = "Right Stick X", 125 | Target = InputControlType.RightStickX, 126 | Source = Analog2 127 | }, 128 | new InputControlMapping { 129 | Handle = "Right Stick Y", 130 | Target = InputControlType.RightStickY, 131 | Source = Analog3, 132 | Invert = true 133 | } 134 | }; 135 | } 136 | } 137 | } 138 | 139 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3ShenghicWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7737b2b34b3c49d28cc85fefa7670a8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation3WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb71f5e575d7143889e34a9deb58b8be 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4AndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc79200a7e6364af3ac666e3ed3c1bd4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee0173926a748490b844f209e48aa364 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4MacBTProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 808c4b8146aef4add98c4abc6f2b49eb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4MacUSBProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c2cd6f808adc4a5391eb5552b3edb48 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4Profile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fc3a1f6ad8734200904d98198ac1ff4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStation4WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b10bd08a3217845da96176a8901301f9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStationVitaPSMProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class PlayStationVitaPSMProfile : UnityInputDeviceProfile 9 | { 10 | public PlayStationVitaPSMProfile() 11 | { 12 | Name = "PlayStation Mobile"; 13 | Meta = "PlayStation Mobile on Vita"; 14 | 15 | SupportedPlatforms = new[] { 16 | "PSM UNITY FOR PSM", 17 | "PSM ON PS VITA", 18 | "PS VITA", 19 | "PSP2OS" 20 | }; 21 | 22 | JoystickNames = new[] { 23 | "PS Vita" 24 | }; 25 | 26 | ButtonMappings = new[] { 27 | new InputControlMapping { 28 | Handle = "Cross", 29 | Target = InputControlType.Action1, 30 | Source = Button0 31 | }, 32 | new InputControlMapping { 33 | Handle = "Circle", 34 | Target = InputControlType.Action2, 35 | Source = Button1 36 | }, 37 | new InputControlMapping { 38 | Handle = "Square", 39 | Target = InputControlType.Action3, 40 | Source = Button2 41 | }, 42 | new InputControlMapping { 43 | Handle = "Triangle", 44 | Target = InputControlType.Action4, 45 | Source = Button3 46 | }, 47 | new InputControlMapping { 48 | Handle = "Left Bumper", 49 | Target = InputControlType.LeftBumper, 50 | Source = Button4 51 | }, 52 | new InputControlMapping { 53 | Handle = "Right Bumper", 54 | Target = InputControlType.RightBumper, 55 | Source = Button5 56 | }, 57 | new InputControlMapping { 58 | Handle = "Select", 59 | Target = InputControlType.Select, 60 | Source = Button6 61 | }, 62 | new InputControlMapping { 63 | Handle = "Start", 64 | Target = InputControlType.Start, 65 | Source = Button7 66 | } 67 | }; 68 | 69 | AnalogMappings = new[] { 70 | new InputControlMapping { 71 | Handle = "Left Stick X", 72 | Target = InputControlType.LeftStickX, 73 | Source = Analog0 74 | }, 75 | new InputControlMapping { 76 | Handle = "Left Stick Y", 77 | Target = InputControlType.LeftStickY, 78 | Source = Analog1, 79 | Invert = true 80 | }, 81 | new InputControlMapping { 82 | Handle = "Right Stick X", 83 | Target = InputControlType.RightStickX, 84 | Source = Analog3 85 | }, 86 | new InputControlMapping { 87 | Handle = "Right Stick Y", 88 | Target = InputControlType.RightStickY, 89 | Source = Analog4, 90 | Invert = true 91 | }, 92 | new InputControlMapping { 93 | Handle = "DPad Left", 94 | Target = InputControlType.DPadLeft, 95 | Source = Analog5, 96 | SourceRange = InputControlMapping.Range.Negative, 97 | TargetRange = InputControlMapping.Range.Negative, 98 | Invert = true 99 | }, 100 | new InputControlMapping { 101 | Handle = "DPad Right", 102 | Target = InputControlType.DPadRight, 103 | Source = Analog5, 104 | SourceRange = InputControlMapping.Range.Positive, 105 | TargetRange = InputControlMapping.Range.Positive 106 | }, 107 | new InputControlMapping { 108 | Handle = "DPad Up", 109 | Target = InputControlType.DPadUp, 110 | Source = Analog6, 111 | SourceRange = InputControlMapping.Range.Positive, 112 | TargetRange = InputControlMapping.Range.Positive 113 | }, 114 | new InputControlMapping { 115 | Handle = "DPad Down", 116 | Target = InputControlType.DPadDown, 117 | Source = Analog6, 118 | SourceRange = InputControlMapping.Range.Negative, 119 | TargetRange = InputControlMapping.Range.Negative, 120 | Invert = true 121 | } 122 | }; 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/PlayStationVitaPSMProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 782a7529c72a14f90bcf6e9bd6a7adab 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SamsungGP20AndroidProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class SamsungGP20AndroidProfile : UnityInputDeviceProfile 9 | { 10 | public SamsungGP20AndroidProfile() 11 | { 12 | Name = "Samgsung Game Pad EI-GP20"; 13 | Meta = "Samgsung Game Pad EI-GP20 on Android"; 14 | 15 | SupportedPlatforms = new[] { 16 | "ANDROID" 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Samsung Game Pad EI-GP20" 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "1", 26 | Target = InputControlType.Action1, 27 | Source = Button0 28 | }, 29 | new InputControlMapping { 30 | Handle = "2", 31 | Target = InputControlType.Action2, 32 | Source = Button1 33 | }, 34 | new InputControlMapping { 35 | Handle = "3", 36 | Target = InputControlType.Action3, 37 | Source = Button2 38 | }, 39 | new InputControlMapping { 40 | Handle = "4", 41 | Target = InputControlType.Action4, 42 | Source = Button3 43 | }, 44 | new InputControlMapping { 45 | Handle = "Left Bumper", 46 | Target = InputControlType.LeftBumper, 47 | Source = Button4 48 | }, 49 | new InputControlMapping { 50 | Handle = "Right Bumper", 51 | Target = InputControlType.RightBumper, 52 | Source = Button5 53 | }, 54 | new InputControlMapping { 55 | Handle = "Select", 56 | Target = InputControlType.Select, 57 | Source = Button11 58 | }, 59 | new InputControlMapping { 60 | Handle = "Start", 61 | Target = InputControlType.Start, 62 | Source = Button10 63 | } 64 | }; 65 | 66 | AnalogMappings = new[] { 67 | new InputControlMapping { 68 | Handle = "Left Stick X", 69 | Target = InputControlType.LeftStickX, 70 | Source = Analog0 71 | }, 72 | new InputControlMapping { 73 | Handle = "Left Stick Y", 74 | Target = InputControlType.LeftStickY, 75 | Source = Analog1, 76 | Invert = true 77 | }, 78 | new InputControlMapping { 79 | Handle = "Right Stick X", 80 | Target = InputControlType.RightStickX, 81 | Source = Analog2 82 | }, 83 | new InputControlMapping { 84 | Handle = "Right Stick Y", 85 | Target = InputControlType.RightStickY, 86 | Source = Analog3, 87 | Invert = true 88 | }, 89 | new InputControlMapping { 90 | Handle = "DPad Left", 91 | Target = InputControlType.DPadLeft, 92 | Source = Analog4, 93 | SourceRange = InputControlMapping.Range.Negative, 94 | TargetRange = InputControlMapping.Range.Negative, 95 | Invert = true 96 | }, 97 | new InputControlMapping { 98 | Handle = "DPad Right", 99 | Target = InputControlType.DPadRight, 100 | Source = Analog4, 101 | SourceRange = InputControlMapping.Range.Positive, 102 | TargetRange = InputControlMapping.Range.Positive 103 | }, 104 | new InputControlMapping { 105 | Handle = "DPad Up", 106 | Target = InputControlType.DPadUp, 107 | Source = Analog5, 108 | SourceRange = InputControlMapping.Range.Negative, 109 | TargetRange = InputControlMapping.Range.Negative, 110 | Invert = true 111 | }, 112 | new InputControlMapping { 113 | Handle = "DPad Down", 114 | Target = InputControlType.DPadDown, 115 | Source = Analog5, 116 | SourceRange = InputControlMapping.Range.Positive, 117 | TargetRange = InputControlMapping.Range.Positive 118 | } 119 | }; 120 | } 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SamsungGP20AndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e582333a49ad644c8912f54326c659c0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SpeedlinkStrikeMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17b41a155d2944b8fbc211c0aaa4325c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SpeedlinkStrikeWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fb8f4e680cf7496792867584ac46b90 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SteelSeriesFreeLinuxProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace InControl 5 | { 6 | // @cond nodoc 7 | [AutoDiscover] 8 | public class SteelSeriesFreeLinuxProfile : UnityInputDeviceProfile 9 | { 10 | public SteelSeriesFreeLinuxProfile() 11 | { 12 | Name = "SteelSeries Free"; 13 | Meta = "SteelSeries Free on Linux"; 14 | 15 | SupportedPlatforms = new[] { 16 | "Linux", 17 | }; 18 | 19 | JoystickNames = new[] { 20 | "Zeemote: SteelSeries FREE" 21 | }; 22 | 23 | ButtonMappings = new[] { 24 | new InputControlMapping { 25 | Handle = "4", 26 | Target = InputControlType.Action1, 27 | Source = Button0 28 | }, 29 | new InputControlMapping { 30 | Handle = "3", 31 | Target = InputControlType.Action2, 32 | Source = Button1 33 | }, 34 | new InputControlMapping { 35 | Handle = "1", 36 | Target = InputControlType.Action3, 37 | Source = Button3 38 | }, 39 | new InputControlMapping { 40 | Handle = "2", 41 | Target = InputControlType.Action4, 42 | Source = Button4 43 | }, 44 | new InputControlMapping { 45 | Handle = "Left Bumper", 46 | Target = InputControlType.LeftBumper, 47 | Source = Button6 48 | }, 49 | new InputControlMapping { 50 | Handle = "Right Bumper", 51 | Target = InputControlType.RightBumper, 52 | Source = Button7 53 | }, 54 | 55 | new InputControlMapping { 56 | Handle = "Back", 57 | Target = InputControlType.Select, 58 | Source = Button12 59 | }, 60 | new InputControlMapping { 61 | Handle = "Start", 62 | Target = InputControlType.Start, 63 | Source = Button11 64 | } 65 | }; 66 | 67 | AnalogMappings = new[] { 68 | new InputControlMapping { 69 | Handle = "Left Stick X", 70 | Target = InputControlType.LeftStickX, 71 | Source = Analog0 72 | }, 73 | new InputControlMapping { 74 | Handle = "Left Stick Y", 75 | Target = InputControlType.LeftStickY, 76 | Source = Analog1, 77 | Invert = true 78 | }, 79 | new InputControlMapping { 80 | Handle = "Right Stick X", 81 | Target = InputControlType.RightStickX, 82 | Source = Analog2 83 | }, 84 | new InputControlMapping { 85 | Handle = "Right Stick Y", 86 | Target = InputControlType.RightStickY, 87 | Source = Analog3, 88 | Invert = true 89 | }, 90 | new InputControlMapping { 91 | Handle = "DPad Left", 92 | Target = InputControlType.DPadLeft, 93 | Source = Analog4, 94 | SourceRange = InputControlMapping.Range.Negative, 95 | TargetRange = InputControlMapping.Range.Negative, 96 | Invert = true 97 | }, 98 | new InputControlMapping { 99 | Handle = "DPad Right", 100 | Target = InputControlType.DPadRight, 101 | Source = Analog4, 102 | SourceRange = InputControlMapping.Range.Positive, 103 | TargetRange = InputControlMapping.Range.Positive 104 | }, 105 | new InputControlMapping { 106 | Handle = "DPad Up", 107 | Target = InputControlType.DPadUp, 108 | Source = Analog5, 109 | SourceRange = InputControlMapping.Range.Negative, 110 | TargetRange = InputControlMapping.Range.Negative, 111 | Invert = true 112 | }, 113 | new InputControlMapping { 114 | Handle = "DPad Down", 115 | Target = InputControlType.DPadDown, 116 | Source = Analog5, 117 | SourceRange = InputControlMapping.Range.Positive, 118 | TargetRange = InputControlMapping.Range.Positive, 119 | Invert = false 120 | } 121 | }; 122 | } 123 | } 124 | } 125 | 126 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SteelSeriesFreeLinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1aa41884759d40619d6e229687cbe95 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SteelSeriesFreeMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24ec9e1eba0004a159018e76afa97ac8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/SteelSeriesFreeWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72056303b572e454b95b916030a99297 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/ValveStreamingWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42ee9f53f428143a8b0444b8f31430dc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/Xbox360AndroidProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21de40203f5704dd3ab09818db8667e6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/Xbox360LinuxProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef90acf26b8b343d98d6a44c9f000b16 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/Xbox360MacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2043ac890529d4001b285c8f3814239e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/Xbox360WinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbaa8cf0a5080454994c80f8f68a564f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/XboxOneMacProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d18f352020dcf40bcb258122b32e337a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/XboxOneProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e33c6cea5332b4eeb89fb4972594a1bc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/DeviceProfiles/XboxOneWinProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e2d225caa1d94a93bcc84ca8e0518fc 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityInputDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c43d7af44d624607a26e3a67a87b9ab 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityInputDeviceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36a3af59792064848b05061b938f3e8a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityInputDeviceProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 576d0f88f6ce245a19cf491efd613bd4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityInputDeviceProfileList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace InControl 6 | { 7 | public class UnityInputDeviceProfileList : ScriptableObject 8 | { 9 | public static string[] Profiles = new string[] 10 | { 11 | "InControl.AmazonFireTVProfile", 12 | "InControl.AmazonFireTVRemote", 13 | "InControl.AndroidTVProfile", 14 | "InControl.AndroidTVRemoteProfile", 15 | "InControl.AppleMFiProfile", 16 | "InControl.ExecutionerXProfile", 17 | "InControl.GameStickLinuxProfile", 18 | "InControl.GameStickProfile", 19 | "InControl.GenericAndroidProfile", 20 | "InControl.GenericBlackBerryProfile", 21 | "InControl.GenericLinuxProfile", 22 | "InControl.GoogleNexusPlayerProfile", 23 | "InControl.GoogleNexusPlayerRemoteProfile", 24 | "InControl.GreenThrottleAtlasAndroidProfile", 25 | "InControl.HamaBlackForceWinProfile", 26 | "InControl.LogitechF310LinuxProfile", 27 | "InControl.LogitechF310ModeDMacProfile", 28 | "InControl.LogitechF310ModeDWinProfile", 29 | "InControl.LogitechF310ModeXMacProfile", 30 | "InControl.LogitechF310ModeXWinProfile", 31 | "InControl.LogitechF510LinuxProfile", 32 | "InControl.LogitechF510WinProfile", 33 | "InControl.LogitechF710LinuxProfile", 34 | "InControl.LogitechF710MacProfile", 35 | "InControl.LogitechF710ModeDWinProfile", 36 | "InControl.LogitechF710ModeXWinProfile", 37 | "InControl.LogitechRumblePad2MacProfile", 38 | "InControl.LogitechRumblePad2WinProfile", 39 | "InControl.LogitechWingManWinProfile", 40 | "InControl.MaxFireBlaze5Profile", 41 | "InControl.MogaProLinuxProfile", 42 | "InControl.MogaProMacProfile", 43 | "InControl.MogaProWinProfile", 44 | "InControl.NVidiaShieldAndroidProfile", 45 | "InControl.NVidiaShieldTabletProfile", 46 | "InControl.NatecGenesisP44Profile", 47 | "InControl.OuyaLinuxProfile", 48 | "InControl.OuyaWinProfile", 49 | "InControl.PlayStation2WinProfile", 50 | "InControl.PlayStation3AndroidProfile", 51 | "InControl.PlayStation3LinuxProfile", 52 | "InControl.PlayStation3MacProfile", 53 | "InControl.PlayStation3ShenghicWinProfile", 54 | "InControl.PlayStation3WinProfile", 55 | "InControl.PlayStation4AndroidProfile", 56 | "InControl.PlayStation4LinuxProfile", 57 | "InControl.PlayStation4MacBTProfile", 58 | "InControl.PlayStation4MacUSBProfile", 59 | "InControl.PlayStation4Profile", 60 | "InControl.PlayStation4WinProfile", 61 | "InControl.PlayStationVitaPSMProfile", 62 | "InControl.SamsungGP20AndroidProfile", 63 | "InControl.SpeedlinkStrikeMacProfile", 64 | "InControl.SpeedlinkStrikeWinProfile", 65 | "InControl.SteelSeriesFreeLinuxProfile", 66 | "InControl.SteelSeriesFreeMacProfile", 67 | "InControl.SteelSeriesFreeWinProfile", 68 | "InControl.ValveStreamingWinProfile", 69 | "InControl.Xbox360AndroidProfile", 70 | "InControl.Xbox360LinuxProfile", 71 | "InControl.Xbox360MacProfile", 72 | "InControl.Xbox360WinProfile", 73 | "InControl.XboxOneMacProfile", 74 | "InControl.XboxOneProfile", 75 | "InControl.XboxOneWinProfile", 76 | }; 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityInputDeviceProfileList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4156265165e994e96883cb1c766d6583 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityUnknownDeviceProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace InControl 7 | { 8 | public class UnityUnknownDeviceProfile : UnityInputDeviceProfile 9 | { 10 | public UnityUnknownDeviceProfile( string joystickName ) 11 | { 12 | Name = "Unknown Device"; 13 | if (joystickName != "") 14 | { 15 | Name += " (" + joystickName + ")"; 16 | } 17 | 18 | Meta = ""; 19 | Sensitivity = 1.0f; 20 | LowerDeadZone = 0.2f; 21 | 22 | SupportedPlatforms = null; 23 | JoystickNames = new[] { joystickName }; 24 | 25 | AnalogMappings = new InputControlMapping[ UnityInputDevice.MaxAnalogs ]; 26 | for (int i = 0; i < UnityInputDevice.MaxAnalogs; i++) 27 | { 28 | AnalogMappings[i] = new InputControlMapping 29 | { 30 | Handle = "Analog " + i, 31 | Source = Analog( i ), 32 | Target = InputControlType.Analog0 + i 33 | }; 34 | } 35 | 36 | ButtonMappings = new InputControlMapping[ UnityInputDevice.MaxButtons ]; 37 | for (int i = 0; i < UnityInputDevice.MaxButtons; i++) 38 | { 39 | ButtonMappings[i] = new InputControlMapping 40 | { 41 | Handle = "Button " + i, 42 | Source = Button( i ), 43 | Target = InputControlType.Button0 + i 44 | }; 45 | } 46 | } 47 | 48 | 49 | public override bool IsKnown 50 | { 51 | get { return false; } 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Unity/UnityUnknownDeviceProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d39d64ac0b79c4dbb9d4912da20247de 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b629418e40404e2d9ce9e5d5ae3c693 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Utility/SingletonMonoBehavior.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | 4 | namespace InControl 5 | { 6 | public class SingletonMonoBehavior : MonoBehaviour where T : MonoBehaviour 7 | { 8 | public static T Instance { get; private set; } 9 | 10 | private static object _lock = new object(); 11 | 12 | 13 | protected void SetSingletonInstance() 14 | { 15 | lock (_lock) 16 | { 17 | if (Instance == null) 18 | { 19 | var instances = FindObjectsOfType() as T[]; 20 | if (instances.Length > 0) 21 | { 22 | Instance = instances[0]; 23 | 24 | if (instances.Length > 1) 25 | { 26 | Debug.LogWarning( "Multiple instances of singleton " + typeof(T) + " found." ); 27 | } 28 | } 29 | else 30 | { 31 | Debug.LogError( "No instance of singleton " + typeof(T) + " found." ); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/InControl/Source/Utility/SingletonMonoBehavior.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fadcc7f9c1db4b069a415f1da269e5d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/Utility/Utility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c16c380ccbab49f0a636bd5ec1fce50 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/VersionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using UnityEngine; 4 | 5 | 6 | namespace InControl 7 | { 8 | public struct VersionInfo : IComparable 9 | { 10 | public int Major; 11 | public int Minor; 12 | public int Patch; 13 | public int Build; 14 | 15 | 16 | public VersionInfo( int major, int minor = 0, int patch = 0, int build = 0 ) 17 | { 18 | Major = major; 19 | Minor = minor; 20 | Patch = patch; 21 | Build = build; 22 | } 23 | 24 | 25 | public static VersionInfo InControlVersion() 26 | { 27 | return new VersionInfo() { 28 | Major = 1, 29 | Minor = 4, 30 | Patch = 4, 31 | Build = 3776 32 | }; 33 | } 34 | 35 | 36 | public static VersionInfo UnityVersion() 37 | { 38 | var match = Regex.Match( Application.unityVersion, @"^(\d+)\.(\d+)\.(\d+)" ); 39 | var build = 0; 40 | return new VersionInfo() { 41 | Major = Convert.ToInt32( match.Groups[1].Value ), 42 | Minor = Convert.ToInt32( match.Groups[2].Value ), 43 | Patch = Convert.ToInt32( match.Groups[3].Value ), 44 | Build = build 45 | }; 46 | } 47 | 48 | 49 | public int CompareTo( VersionInfo other ) 50 | { 51 | if (Major < other.Major) return -1; 52 | if (Major > other.Major) return +1; 53 | if (Minor < other.Minor) return -1; 54 | if (Minor > other.Minor) return +1; 55 | if (Patch < other.Patch) return -1; 56 | if (Patch > other.Patch) return +1; 57 | if (Build < other.Build) return -1; 58 | if (Build > other.Build) return +1; 59 | return 0; 60 | } 61 | 62 | 63 | public static bool operator ==( VersionInfo a, VersionInfo b ) 64 | { 65 | return a.CompareTo( b ) == 0; 66 | } 67 | 68 | 69 | public static bool operator !=( VersionInfo a, VersionInfo b ) 70 | { 71 | return a.CompareTo( b ) != 0; 72 | } 73 | 74 | 75 | public static bool operator <=( VersionInfo a, VersionInfo b ) 76 | { 77 | return a.CompareTo( b ) <= 0; 78 | } 79 | 80 | 81 | public static bool operator >=( VersionInfo a, VersionInfo b ) 82 | { 83 | return a.CompareTo( b ) >= 0; 84 | } 85 | 86 | 87 | public static bool operator <( VersionInfo a, VersionInfo b ) 88 | { 89 | return a.CompareTo( b ) < 0; 90 | } 91 | 92 | 93 | public static bool operator >( VersionInfo a, VersionInfo b ) 94 | { 95 | return a.CompareTo( b ) > 0; 96 | } 97 | 98 | 99 | public override string ToString() 100 | { 101 | if (Build == 0) 102 | { 103 | return string.Format( "{0}.{1}.{2}", Major, Minor, Patch ); 104 | } 105 | return string.Format( "{0}.{1}.{2} build {3}", Major, Minor, Patch, Build ); 106 | } 107 | 108 | 109 | public string ToShortString() 110 | { 111 | if (Build == 0) 112 | { 113 | return string.Format( "{0}.{1}.{2}", Major, Minor, Patch ); 114 | } 115 | return string.Format( "{0}.{1}.{2}b{3}", Major, Minor, Patch, Build ); 116 | } 117 | 118 | 119 | public override bool Equals( object other ) 120 | { 121 | if (other is VersionInfo) 122 | { 123 | return this == ((VersionInfo) other); 124 | } 125 | return false; 126 | } 127 | 128 | 129 | public override int GetHashCode() 130 | { 131 | return Major.GetHashCode() ^ Minor.GetHashCode() ^ Patch.GetHashCode() ^ Build.GetHashCode(); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /Assets/InControl/Source/VersionInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28aa9c3c1243246f29f80bc029737429 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f445701565c9d4cda8cc509c9ebf82c5 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84a8b7d76fb854fd996c8368c1db87b2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDeviceManager.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_WIN || UNITY_EDITOR 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using XInputDotNetPure; 7 | 8 | 9 | namespace InControl 10 | { 11 | public class XInputDeviceManager : InputDeviceManager 12 | { 13 | bool[] deviceConnected = new bool[] { false, false, false, false }; 14 | 15 | 16 | public XInputDeviceManager() 17 | { 18 | for (int deviceIndex = 0; deviceIndex < 4; deviceIndex++) 19 | { 20 | devices.Add( new XInputDevice( deviceIndex ) ); 21 | } 22 | 23 | Update( 0, 0.0f ); 24 | } 25 | 26 | 27 | public override void Update( ulong updateTick, float deltaTime ) 28 | { 29 | for (int deviceIndex = 0; deviceIndex < 4; deviceIndex++) 30 | { 31 | var device = devices[deviceIndex] as XInputDevice; 32 | 33 | // Unconnected devices won't be updated otherwise, so poll here. 34 | if (!device.IsConnected) 35 | { 36 | device.Update( updateTick, deltaTime ); 37 | } 38 | 39 | if (device.IsConnected != deviceConnected[deviceIndex]) 40 | { 41 | if (device.IsConnected) 42 | { 43 | InputManager.AttachDevice( device ); 44 | } 45 | else 46 | { 47 | InputManager.DetachDevice( device ); 48 | } 49 | 50 | deviceConnected[deviceIndex] = device.IsConnected; 51 | } 52 | } 53 | } 54 | 55 | 56 | public static bool CheckPlatformSupport( ICollection errors ) 57 | { 58 | if (Application.platform != RuntimePlatform.WindowsPlayer && 59 | Application.platform != RuntimePlatform.WindowsEditor) 60 | { 61 | return false; 62 | } 63 | 64 | try 65 | { 66 | GamePad.GetState( PlayerIndex.One ); 67 | } 68 | catch (DllNotFoundException e) 69 | { 70 | if (errors != null) 71 | { 72 | errors.Add( e.Message + ".dll could not be found or is missing a dependency." ); 73 | } 74 | return false; 75 | } 76 | 77 | return true; 78 | } 79 | 80 | 81 | public static void Enable() 82 | { 83 | var errors = new List(); 84 | if (XInputDeviceManager.CheckPlatformSupport( errors )) 85 | { 86 | InputManager.HideDevicesWithProfile( typeof(Xbox360WinProfile) ); 87 | InputManager.HideDevicesWithProfile( typeof(XboxOneWinProfile) ); 88 | InputManager.HideDevicesWithProfile( typeof(LogitechF710ModeXWinProfile) ); 89 | InputManager.HideDevicesWithProfile( typeof(LogitechF310ModeXWinProfile) ); 90 | InputManager.AddDeviceManager(); 91 | } 92 | else 93 | { 94 | foreach (var error in errors) 95 | { 96 | Logger.LogError( error ); 97 | } 98 | } 99 | } 100 | } 101 | } 102 | #endif 103 | 104 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDeviceManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bfdb776fa3614588b8bf2eb57e5402e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDotNetPure.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b603aeedfc43b498282217db727ad41d 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDotNetPure/GamePad.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4443c7055dc8e4288966deaf9b1d3244 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDotNetPure/Utils.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_WIN || UNITY_EDITOR 2 | using System; 3 | 4 | 5 | namespace XInputDotNetPure 6 | { 7 | static class Utils 8 | { 9 | public const uint Success = 0x000; 10 | public const uint NotConnected = 0x000; 11 | 12 | private const int LeftStickDeadZone = 7849; 13 | private const int RightStickDeadZone = 8689; 14 | private const int TriggerDeadZone = 30; 15 | 16 | 17 | public static float ApplyTriggerDeadZone( byte value, GamePadDeadZone deadZoneMode ) 18 | { 19 | if (deadZoneMode == GamePadDeadZone.None) 20 | { 21 | return ApplyDeadZone( value, byte.MaxValue, 0.0f ); 22 | } 23 | else 24 | { 25 | return ApplyDeadZone( value, byte.MaxValue, TriggerDeadZone ); 26 | } 27 | } 28 | 29 | 30 | public static GamePadThumbSticks.StickValue ApplyLeftStickDeadZone( short valueX, short valueY, GamePadDeadZone deadZoneMode ) 31 | { 32 | return ApplyStickDeadZone( valueX, valueY, deadZoneMode, LeftStickDeadZone ); 33 | } 34 | 35 | 36 | public static GamePadThumbSticks.StickValue ApplyRightStickDeadZone(short valueX, short valueY, GamePadDeadZone deadZoneMode) 37 | { 38 | return ApplyStickDeadZone( valueX, valueY, deadZoneMode, RightStickDeadZone ); 39 | } 40 | 41 | 42 | private static GamePadThumbSticks.StickValue ApplyStickDeadZone( short valueX, short valueY, GamePadDeadZone deadZoneMode, int deadZoneSize ) 43 | { 44 | if (deadZoneMode == GamePadDeadZone.Circular) 45 | { 46 | // Cast to long to avoid int overflow if valueX and valueY are both 32768, which would result in a negative number and Sqrt returns NaN 47 | float distanceFromCenter = (float)Math.Sqrt((long)valueX * (long)valueX + (long)valueY * (long)valueY); 48 | float coefficient = ApplyDeadZone(distanceFromCenter, short.MaxValue, deadZoneSize); 49 | coefficient = coefficient > 0.0f ? coefficient / distanceFromCenter : 0.0f; 50 | return new GamePadThumbSticks.StickValue( 51 | Clamp(valueX * coefficient), 52 | Clamp(valueY * coefficient) 53 | ); 54 | } 55 | else if (deadZoneMode == GamePadDeadZone.IndependentAxes) 56 | { 57 | return new GamePadThumbSticks.StickValue( 58 | ApplyDeadZone(valueX, short.MaxValue, deadZoneSize), 59 | ApplyDeadZone(valueY, short.MaxValue, deadZoneSize) 60 | ); 61 | } 62 | else 63 | { 64 | return new GamePadThumbSticks.StickValue( 65 | ApplyDeadZone(valueX, short.MaxValue, 0.0f), 66 | ApplyDeadZone(valueY, short.MaxValue, 0.0f) 67 | ); 68 | } 69 | } 70 | 71 | 72 | private static float Clamp( float value ) 73 | { 74 | return value < -1.0f ? -1.0f : (value > 1.0f ? 1.0f : value); 75 | } 76 | 77 | 78 | private static float ApplyDeadZone( float value, float maxValue, float deadZoneSize ) 79 | { 80 | if (value < -deadZoneSize) 81 | { 82 | value += deadZoneSize; 83 | } 84 | else if (value > deadZoneSize) 85 | { 86 | value -= deadZoneSize; 87 | } 88 | else 89 | { 90 | return 0.0f; 91 | } 92 | 93 | value /= maxValue - deadZoneSize; 94 | 95 | return Clamp(value); 96 | } 97 | } 98 | } 99 | #endif 100 | 101 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputDotNetPure/Utils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e51e332aa366e4e829e07220bd93e6ee 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputInterface.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Source/XInput/XInputInterface.dll -------------------------------------------------------------------------------- /Assets/InControl/Source/XInput/XInputInterface.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0df7bbb39137d474fb50b4ac37081c45 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/InControl/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4734581d8f0724484b3c741922ee7ced 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/InControl/Test/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Test/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Assets/InControl/Test/Roboto-Regular.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0410ad49c91d744308a3357425d86f3a 3 | TrueTypeFontImporter: 4 | serializedVersion: 2 5 | fontSize: 12 6 | forceTextureCase: -2 7 | characterSpacing: 1 8 | characterPadding: 0 9 | includeFontData: 1 10 | use2xBehaviour: 0 11 | fontNames: [] 12 | customCharacters: 13 | fontRenderingMode: 0 14 | userData: 15 | -------------------------------------------------------------------------------- /Assets/InControl/Test/TestInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ded6578543d634a73af69502ee294507 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: -50 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/InControl/Test/TestInputManager.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Assets/InControl/Test/TestInputManager.unity -------------------------------------------------------------------------------- /Assets/InControl/Test/TestInputManager.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5732134fbcf2c404ea75451f03d6392e 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | v1.4.4 2 | Fixed Unity 5 deprecation. 3 | 4 | v1.4.2 5 | Added MaxFire Blaze5 Windows profile. 6 | Added Xbox One Mac profile. 7 | Added Logitech F710 Linux profile. 8 | Fixed NVidia Shield Windows profile. 9 | Fixed Xbox One Mac profile. 10 | Fixed PlayStation4 Android profile. 11 | Added devkit support to PS Vita profile. 12 | Added InControlType.Options 13 | 14 | v1.3.9 15 | Properly namespace Utility class. 16 | Added None to InputControlType enum. 17 | Added Nvidia Shield Windows profile. 18 | Added Google Nexus Player profiles. 19 | Updated Amazon Fire TV Remote profile. 20 | Made TouchControlEditor more subclass friendly. 21 | 22 | v1.3.8 23 | NVidia Shield controller matches more reliably. 24 | Fix compatibility attributes for builds in Unity 4.3 25 | Fix for PS4 Mac BT profile on OS X 10.10 26 | Fixed build error on Windows 8 27 | Lazy load InputManager.UnityVersion. 28 | Updated Speedlink Strike Mac profile. 29 | Updated PS Vita profile. 30 | Updated InControlInputModule for Unity 4.6 RC2. 31 | 32 | v1.3.7 33 | Updated InControlInputModule for Unity 4.6b20 changes. 34 | Renamed Library folder to Source because it breaks Unity Cloud Build. 35 | XInput devices now report their names as "XInput Controller" 36 | Fixed mappings in PS3 Android profile. 37 | Minor bug fixes in touch controls. 38 | 39 | v1.3.4 40 | Fixed crash in iOS builds. 41 | Updated InControlInputModule for new Unity 4.6 GUI support. 42 | 43 | v1.3.0 44 | Improved touch controls API including pixel sizing and positioning. 45 | Added OuyaEverywhere SDK support (replaces old Ouya SDK support). 46 | Added InControlInputModule for new Unity GUI event system (Unity 4.6+). 47 | Updated InputManager settings generator for Unity 4.6 compatibility. 48 | Added PlayStation 4 console profile. 49 | Added XBox One console profile. 50 | Added Natec Genesis P44 Windows profile. 51 | Made the InputManager settings generator as non-destructive as possible. 52 | Make the profile list generator ignore whitespace. 53 | Fix for funky trigger behavior when app loses focus. 54 | 55 | v1.2.1 56 | Better support for scene switching. 57 | Added space, header and range property attributes for Unity 4.3 compatibility. 58 | Fix for building Windows Store apps. 59 | Fix to Xbox One profile for split axes triggers. 60 | Improved Logitech F310 / Dual Action support. 61 | Added PlayStation 3 Android profile. 62 | Map Xbox back button to InputControlType.Back instead of InputControlType.Select 63 | Add InputControlType.View for Xbox One controller. 64 | Create system compatible newlines when generating profile list. 65 | Disable Xbox One profile if XInput is used. 66 | 67 | v1.2.0 68 | The long awaited touch control support has landed! 69 | Bug fixes for a few controllers. 70 | KeyCodeButton control source can take multiple KeyCodes now. 71 | New KeyCodeComboButton control source. -------------------------------------------------------------------------------- /Images/Controller.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Controller.ai -------------------------------------------------------------------------------- /Images/Controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Controller.png -------------------------------------------------------------------------------- /Images/Logos.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Logos.ai -------------------------------------------------------------------------------- /Images/LogosOld.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/LogosOld.ai -------------------------------------------------------------------------------- /Images/Logos_Logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Logos_Logo1.png -------------------------------------------------------------------------------- /Images/Logos_Logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Logos_Logo2.png -------------------------------------------------------------------------------- /Images/Logos_Logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/Logos_Logo3.png -------------------------------------------------------------------------------- /Images/ScreenShot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/ScreenShot1.png -------------------------------------------------------------------------------- /Images/ScreenShot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/ScreenShot2.png -------------------------------------------------------------------------------- /Images/ScreenShot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/ScreenShot3.png -------------------------------------------------------------------------------- /Images/ScreenShot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/ScreenShot4.png -------------------------------------------------------------------------------- /Images/ScreenShot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Images/ScreenShot5.png -------------------------------------------------------------------------------- /InControl.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "follow_symlinks": true, 6 | "path": ".", 7 | "folder_exclude_patterns": 8 | [ 9 | "ProjectSettings", 10 | "Library", 11 | "obj", 12 | "Temp" 13 | ], 14 | "file_exclude_patterns": 15 | [ 16 | "*.dll", 17 | "*.meta" 18 | ] 19 | } 20 | ], 21 | "settings": 22 | { 23 | "completesharp_mono_path": "/Applications/Unity/MonoDevelop.app/Contents/MacOS/monodevelop", 24 | "completesharp_assemblies": [ 25 | "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll", 26 | "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll", 27 | "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/nunit.framework.dll", 28 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/UnityScript.dll", 29 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Core.dll", 30 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.dll", 31 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/mscorlib.dll", 32 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Core.dll", 33 | "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.dll", 34 | // "${project_path:Library}/ScriptAssemblies/Assembly-CSharp.dll", 35 | // "${project_path:Library}/ScriptAssemblies/Assembly-CSharp-Editor.dll", 36 | // "${project_path:Library}/ScriptAssemblies/Assembly-UnityScript-Editor.dll", 37 | // "${project_path:Library}/ScriptAssemblies/Assembly-CSharp-firstpass.dll" 38 | ], 39 | "completioncommon_inhibit_sublime_completions": true, 40 | "completioncommon_shorten_names": true 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/Packages/.gitkeep -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ## NOTICE 2 | 3 | This open source edition of InControl is now discontinued. It will be frozen at version 1.4.4. This repository will remain available, but no new features will be added or significant changes made. 4 | 5 | Future feature development continues on the [Unity Asset Store version](http://u3d.as/6mr) exclusively. 6 | 7 | For more information on this change, please see this blog post: [http://www.gallantgames.com/posts/30/incontrol-state-of-the-asset](http://www.gallantgames.com/posts/30/incontrol-state-of-the-asset). 8 | 9 | ## Description 10 | 11 | InControl is an input manager for Unity3D that standardizes input mappings across various platforms for common controllers. 12 | 13 | Documentation is available at: [http://www.gallantgames.com/incontrol](http://www.gallantgames.com/incontrol) 14 | 15 | InControl is also [available on the Unity Asset Store](http://u3d.as/6mr) for a modest price. If you find this project beneficial, please consider supporting its ongoing development. You'll have the convenience of easy installation and updates right from the Unity Editor. Certain features are available on the Asset Store version only, and will not be open sourced in the repository. 16 | 17 | Current features available only in the Asset Store include: 18 | 19 | * Runtime [rebindable controls](http://www.gallantgames.com/pages/incontrol-binding-actions-to-controls) (controller, keyboard and mouse). 20 | * [Touch controls](http://www.gallantgames.com/pages/incontrol-touch-controls) to emulate virtual controller. 21 | * [OUYA Everywhere](http://www.gallantgames.com/pages/incontrol-ouya) SDK support. 22 | * [Input module](http://www.gallantgames.com/pages/incontrol-new-unity-gui) for new Unity GUI integration. 23 | 24 | ## License 25 | 26 | You may use InControl, modified or unmodified, in any and all games that you create for both commercial and non-commercial purposes. However, in the spirit of this being an open source project, it is expressly forbidden to sell or commercially distribute InControl apart from your games. It may under no circumstances be repackaged or included in any plugin sold on the Unity Asset Store or elsewhere, whether in source or DLL form. No exceptions. 27 | 28 | Handcrafted by Patrick Hogan [[twitter](http://twitter.com/pbhogan) • [github](http://github.com/pbhogan) • [website](http://www.gallantgames.com/incontrol)] 29 | 30 | -------------------------------------------------------------------------------- /XInputInterface.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbhogan/InControl/17661d457f8cdb09d0d1b4d2a3482d5d5f1a3603/XInputInterface.dll -------------------------------------------------------------------------------- /changed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git log --pretty=format:%s `git describe --abbrev=0 --tags`..HEAD --------------------------------------------------------------------------------