From c8c9e8a7b3c2356369e2b16019bdbdc5247eae5b Mon Sep 17 00:00:00 2001 From: mtschoen-unity Date: Tue, 1 Aug 2023 10:39:49 -0700 Subject: [PATCH] FIX: Fix InputControls for precompiled layouts (ISXB-551) (#1701) * Fix input controls and devices that fail to compile in precompiled layouts; Add a test to catch any types that will not work in a precompiled layout * Update changelog * Run format tool * Update package version * 1.6.4 -> 1.7.0 * add more exceptions to the APIValidator for new protected properties * remove PVS Validation Exceptions as they seem unneeded now --------- Co-authored-by: James McGill --- Assets/Samples/CustomDevice/CustomDevice.cs | 8 +- .../Samples/InGameHints/InGameHintsActions.cs | 2 +- Assets/Samples/SimpleDemo/SimpleControls.cs | 2 +- .../Tests/InputSystem/APIVerificationTests.cs | 92 ++++++++++++++++++ .../Tests/InputSystem/CoreTests_Controls.cs | 66 +++++++++++++ Assets/Tests/InputSystem/CoreTests_Devices.cs | 8 +- Assets/Tests/InputSystem/CoreTests_Events.cs | 4 +- .../Tests/InputSystem/CoreTests_Remoting.cs | 2 +- .../InputActionCodeGeneratorActions.cs | 2 +- .../InputSystem/Plugins/OnScreenTests.cs | 2 +- .../Tests/InputSystem/Plugins/SteamTests.cs | 4 +- Assets/Tests/InputSystem/Plugins/XRTests.cs | 10 +- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + .../InputSystem/AssemblyInfo.cs | 4 +- .../InputSystem/Controls/QuaternionControl.cs | 8 +- .../Devices/Precompiled/FastKeyboard.cs | 2 +- .../Devices/Precompiled/FastMouse.cs | 2 +- .../Devices/Precompiled/FastTouchscreen.cs | 2 +- .../InputSystem/Devices/Sensor.cs | 24 ++--- .../InputSystem/Devices/TrackedDevice.cs | 8 +- .../Plugins/DualShock/DualShockGamepadHID.cs | 6 +- .../Plugins/XInput/XInputController.cs | 4 +- .../Plugins/XR/Controls/PoseControl.cs | 12 +-- .../Plugins/XR/Devices/GoogleVR.cs | 22 ++--- .../InputSystem/Plugins/XR/Devices/Oculus.cs | 92 +++++++++--------- .../InputSystem/Plugins/XR/Devices/OpenVR.cs | 94 +++++++++---------- .../Plugins/XR/Devices/WindowsMR.cs | 44 ++++----- .../InputSystem/Plugins/XR/GenericXRDevice.cs | 12 +-- .../InputSystem/Plugins/XR/XRSupport.cs | 20 ++-- .../Tests/TestFixture/AssemblyInfo.cs | 2 +- .../ValidationExceptions.json | 7 +- Packages/com.unity.inputsystem/package.json | 2 +- .../com.unity.probuilder/Settings.json | 5 - 33 files changed, 362 insertions(+), 213 deletions(-) diff --git a/Assets/Samples/CustomDevice/CustomDevice.cs b/Assets/Samples/CustomDevice/CustomDevice.cs index eaa9844a47..a81c4cdf73 100644 --- a/Assets/Samples/CustomDevice/CustomDevice.cs +++ b/Assets/Samples/CustomDevice/CustomDevice.cs @@ -177,10 +177,10 @@ private static void Initialize() // for it a little bit. One thing we can do is expose the controls for our // device directly. While anyone can look up our controls using strings, exposing // the controls as properties makes it simpler to work with the device in script. - public ButtonControl firstButton { get; private set; } - public ButtonControl secondButton { get; private set; } - public ButtonControl thirdButton { get; private set; } - public StickControl stick { get; private set; } + public ButtonControl firstButton { get; protected set; } + public ButtonControl secondButton { get; protected set; } + public ButtonControl thirdButton { get; protected set; } + public StickControl stick { get; protected set; } // FinishSetup is where our device setup is finalized. Here we can look up // the controls that have been created. diff --git a/Assets/Samples/InGameHints/InGameHintsActions.cs b/Assets/Samples/InGameHints/InGameHintsActions.cs index 8a0566a348..69dd7b0cde 100644 --- a/Assets/Samples/InGameHints/InGameHintsActions.cs +++ b/Assets/Samples/InGameHints/InGameHintsActions.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.6.4 +// version 1.7.0 // from Assets/Samples/InGameHints/InGameHintsActions.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Assets/Samples/SimpleDemo/SimpleControls.cs b/Assets/Samples/SimpleDemo/SimpleControls.cs index 1f2ed319d0..8cc949c6ee 100644 --- a/Assets/Samples/SimpleDemo/SimpleControls.cs +++ b/Assets/Samples/SimpleDemo/SimpleControls.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.6.4 +// version 1.7.0 // from Assets/Samples/SimpleDemo/SimpleControls.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Assets/Tests/InputSystem/APIVerificationTests.cs b/Assets/Tests/InputSystem/APIVerificationTests.cs index 1c2981a0d6..11344c6855 100644 --- a/Assets/Tests/InputSystem/APIVerificationTests.cs +++ b/Assets/Tests/InputSystem/APIVerificationTests.cs @@ -368,6 +368,98 @@ public void API_MonoBehavioursHaveHelpUrls() public ButtonControl tap { get; } public IntegerControl tapCount { get; } public IntegerControl touchId { get; } + public UnityEngine.InputSystem.Controls.ButtonControl app { get; } + public UnityEngine.InputSystem.Controls.Vector3Control deviceAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control deviceVelocity { get; } + public UnityEngine.InputSystem.Controls.ButtonControl home { get; } + public UnityEngine.InputSystem.Controls.ButtonControl recentered { get; } + public UnityEngine.InputSystem.Controls.ButtonControl recentering { get; } + public UnityEngine.InputSystem.Controls.Vector2Control touchpad { get; } + public UnityEngine.InputSystem.Controls.ButtonControl touchpadClicked { get; } + public UnityEngine.InputSystem.Controls.ButtonControl touchpadTouched { get; } + public UnityEngine.InputSystem.Controls.ButtonControl volumeDown { get; } + public UnityEngine.InputSystem.Controls.ButtonControl volumeUp { get; } + public UnityEngine.InputSystem.Controls.ButtonControl back { get; } + public UnityEngine.InputSystem.Controls.Vector3Control deviceAngularAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control deviceAngularVelocity { get; } + public UnityEngine.InputSystem.Controls.AxisControl trigger { get; } + public UnityEngine.InputSystem.Controls.ButtonControl triggerPressed { get; } + public UnityEngine.InputSystem.Controls.Vector3Control centerEyeAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control centerEyeAngularAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control centerEyeAngularVelocity { get; } + public UnityEngine.InputSystem.Controls.Vector3Control leftEyeAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control leftEyeAngularAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control leftEyeAngularVelocity { get; } + public UnityEngine.InputSystem.Controls.Vector3Control rightEyeAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control rightEyeAngularAcceleration { get; } + public UnityEngine.InputSystem.Controls.Vector3Control rightEyeAngularVelocity { get; } + public UnityEngine.InputSystem.Controls.ButtonControl userPresence { get; } + public UnityEngine.InputSystem.Controls.ButtonControl start { get; } + public UnityEngine.InputSystem.Controls.AxisControl grip { get; } + public UnityEngine.InputSystem.Controls.ButtonControl gripPressed { get; } + public UnityEngine.InputSystem.Controls.ButtonControl primaryButton { get; } + public UnityEngine.InputSystem.Controls.ButtonControl primaryTouched { get; } + public UnityEngine.InputSystem.Controls.ButtonControl secondaryButton { get; } + public UnityEngine.InputSystem.Controls.ButtonControl secondaryTouched { get; } + public UnityEngine.InputSystem.Controls.Vector2Control thumbstick { get; } + public UnityEngine.InputSystem.Controls.ButtonControl thumbstickClicked { get; } + public UnityEngine.InputSystem.Controls.ButtonControl thumbstickTouched { get; } + public UnityEngine.InputSystem.Controls.AxisControl triggerTouched { get; } + public UnityEngine.InputSystem.Controls.ButtonControl isTracked { get; } + public UnityEngine.InputSystem.Controls.IntegerControl trackingState { get; } + public UnityEngine.InputSystem.Controls.ButtonControl primary { get; } + public UnityEngine.InputSystem.Controls.ButtonControl trackpadPressed { get; } + public UnityEngine.InputSystem.Controls.Vector2Control joystick { get; } + public UnityEngine.InputSystem.Controls.ButtonControl menu { get; } + public UnityEngine.InputSystem.Controls.ButtonControl touchpadClick { get; } + public UnityEngine.InputSystem.Controls.ButtonControl touchpadTouch { get; } + public UnityEngine.InputSystem.Controls.Vector3Control centerEyeVelocity { get; } + public UnityEngine.InputSystem.Controls.Vector3Control leftEyeVelocity { get; } + public UnityEngine.InputSystem.Controls.Vector3Control rightEyeVelocity { get; } + public UnityEngine.InputSystem.Controls.Vector2Control trackpad { get; } + public UnityEngine.InputSystem.Controls.ButtonControl trackpadTouched { get; } + public Controls.Vector3Control acceleration { get; } + public Controls.AxisControl ambientTemperature { get; } + public Controls.QuaternionControl attitude { get; } + public Controls.Vector3Control gravity { get; } + public Controls.Vector3Control angularVelocity { get; } + public Controls.AxisControl relativeHumidity { get; } + public Controls.AxisControl lightLevel { get; } + public Controls.Vector3Control magneticField { get; } + public Controls.AxisControl atmosphericPressure { get; } + public Controls.AxisControl distance { get; } + public Controls.IntegerControl stepCounter { get; } + public Controls.Vector3Control devicePosition { get; } + public Controls.QuaternionControl deviceRotation { get; } + public Controls.ButtonControl isTracked { get; } + public Controls.IntegerControl trackingState { get; } + public AxisControl w { get; } + public AxisControl x { get; } + public AxisControl y { get; } + public AxisControl z { get; } + public UnityEngine.InputSystem.Controls.ButtonControl leftTriggerButton { get; } + public UnityEngine.InputSystem.Controls.ButtonControl playStationButton { get; } + public UnityEngine.InputSystem.Controls.ButtonControl rightTriggerButton { get; } + public UnityEngine.InputSystem.Controls.ButtonControl view { get; } + public UnityEngine.InputSystem.Controls.IntegerControl parentBoneIndex { get; } + public UnityEngine.InputSystem.Controls.Vector3Control position { get; } + public UnityEngine.InputSystem.Controls.QuaternionControl rotation { get; } + public UnityEngine.InputSystem.Controls.Vector3Control fixationPoint { get; } + public UnityEngine.InputSystem.Controls.AxisControl leftEyeOpenAmount { get; } + public UnityEngine.InputSystem.Controls.Vector3Control leftEyePosition { get; } + public UnityEngine.InputSystem.Controls.QuaternionControl leftEyeRotation { get; } + public UnityEngine.InputSystem.Controls.AxisControl rightEyeOpenAmount { get; } + public UnityEngine.InputSystem.Controls.Vector3Control rightEyePosition { get; } + public UnityEngine.InputSystem.Controls.QuaternionControl rightEyeRotation { get; } + public UnityEngine.InputSystem.Controls.Vector3Control centerEyePosition { get; } + public UnityEngine.InputSystem.Controls.QuaternionControl centerEyeRotation { get; } + public UnityEngine.InputSystem.Controls.ButtonControl airTap { get; } + public UnityEngine.InputSystem.Controls.Vector3Control sourceLossMitigationDirection { get; } + public UnityEngine.InputSystem.Controls.AxisControl sourceLossRisk { get; } + public UnityEngine.InputSystem.Controls.AxisControl batteryLevel { get; } + public UnityEngine.InputSystem.Controls.ButtonControl joystickClicked { get; } + public UnityEngine.InputSystem.Controls.Vector3Control pointerPosition { get; } + public UnityEngine.InputSystem.Controls.QuaternionControl pointerRotation { get; } ")] // InputActionAsset and InputActionMap changed from IInputActionCollection to IInputActionCollection2 with // the latter just being based on the former. diff --git a/Assets/Tests/InputSystem/CoreTests_Controls.cs b/Assets/Tests/InputSystem/CoreTests_Controls.cs index be23f392a2..5a749ab4db 100644 --- a/Assets/Tests/InputSystem/CoreTests_Controls.cs +++ b/Assets/Tests/InputSystem/CoreTests_Controls.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Reflection; using System.Threading; using NUnit.Framework; using Unity.Collections; @@ -8,6 +10,7 @@ using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; +using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Processors; using UnityEngine.InputSystem.Utilities; @@ -1524,4 +1527,67 @@ public void Controls_OptimizedControls_ParentChangesOptimization_IfChildIsNoLong Assert.That(mouse.position.y.optimizedControlDataType, Is.EqualTo(InputStateBlock.FormatFloat)); Assert.That(mouse.position.optimizedControlDataType, Is.EqualTo(InputStateBlock.FormatInvalid)); } + + [Test] + [Category("Controls")] + public void Controls_PrecompiledLayouts_AllChildControlPropertiesHaveSetters() + { + var inputDevice = typeof(InputDevice); + var inputControlType = typeof(InputControl); + var checkedTypes = new HashSet(); + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + try + { + foreach (var type in assembly.GetTypes()) + { + // Skip base types + if (type == inputControlType || type == inputDevice) + continue; + + if (!inputControlType.IsAssignableFrom(type)) + continue; + + CheckChildControls(type, checkedTypes); + } + } + catch (ReflectionTypeLoadException) + { + // Suppress type load exceptions + } + } + } + + static void CheckChildControls(Type type, HashSet checkedTypes) + { + if (!checkedTypes.Add(type)) + return; + + foreach (var property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + if (!typeof(InputControl).IsAssignableFrom(property.PropertyType)) + continue; + + // Note: This will miss InputDevice controls that don't have an InputControlAttribute, but is necessary + // because not all InputControl properties are actually controls. We would need to build the device to know + // for sure if a given property is a control + if (!property.GetCustomAttributes().Any()) + continue; + + var setMethod = property.SetMethod; + if (typeof(InputDevice).IsAssignableFrom(type)) + { + // Properties on an InputDevice can be protected, since the precompiled layout will be an inherited class + var inputDeviceMessage = $"A public or protected setter is required on {type.FullName}.{property.Name} in order to support precompiled layouts"; + Assert.That(setMethod, Is.Not.Null, inputDeviceMessage); + Assert.That(setMethod.IsPrivate, Is.Not.True, inputDeviceMessage); + Assert.That(setMethod.IsAssembly, Is.Not.True, inputDeviceMessage); + continue; + } + + var inputControlMessage = $"A public setter is required on {type.FullName}.{property.Name} in order to support precompiled layouts"; + Assert.That(setMethod, Is.Not.Null, inputControlMessage); + Assert.That(setMethod.IsPublic, Is.True, inputControlMessage); + } + } } diff --git a/Assets/Tests/InputSystem/CoreTests_Devices.cs b/Assets/Tests/InputSystem/CoreTests_Devices.cs index 96c5f2b366..113a128c36 100644 --- a/Assets/Tests/InputSystem/CoreTests_Devices.cs +++ b/Assets/Tests/InputSystem/CoreTests_Devices.cs @@ -1041,7 +1041,7 @@ public void Devices_ChangingStateOfDevice_TriggersNotification() private class TestDeviceThatResetsStateInCallback : InputDevice, IInputStateCallbackReceiver { [InputControl(format = "FLT")] - public ButtonControl button { get; private set; } + public ButtonControl button { get; protected set; } protected override void FinishSetup() { @@ -2029,7 +2029,7 @@ long DeviceCallback(int deviceId, InputDeviceCommand* command, ref bool received class DeviceWithCustomReset : InputDevice, ICustomDeviceReset { [InputControl] - public AxisControl axis { get; private set; } + public AxisControl axis { get; protected set; } protected override void FinishSetup() { @@ -5630,8 +5630,8 @@ public enum Behavior public Behavior behavior = Behavior.PreserveEventsAsIs; - public IntegerControl value1 { get; private set; } - public IntegerControl value2 { get; private set; } + public IntegerControl value1 { get; protected set; } + public IntegerControl value2 { get; protected set; } protected override void FinishSetup() { diff --git a/Assets/Tests/InputSystem/CoreTests_Events.cs b/Assets/Tests/InputSystem/CoreTests_Events.cs index 6759061882..d75e2c7472 100644 --- a/Assets/Tests/InputSystem/CoreTests_Events.cs +++ b/Assets/Tests/InputSystem/CoreTests_Events.cs @@ -2081,7 +2081,7 @@ private struct CustomDeviceState : IInputStateTypeInfo [InputControlLayout(stateType = typeof(CustomDeviceState))] private class CustomDevice : InputDevice { - public AxisControl axis { get; private set; } + public AxisControl axis { get; protected set; } protected override void FinishSetup() { @@ -2549,7 +2549,7 @@ public class TestException : Exception } public bool throwExceptionOnState = true; - public AxisControl axis { get; private set; } + public AxisControl axis { get; protected set; } protected override void FinishSetup() { diff --git a/Assets/Tests/InputSystem/CoreTests_Remoting.cs b/Assets/Tests/InputSystem/CoreTests_Remoting.cs index 21b010ad1a..e8eb988e0a 100644 --- a/Assets/Tests/InputSystem/CoreTests_Remoting.cs +++ b/Assets/Tests/InputSystem/CoreTests_Remoting.cs @@ -532,7 +532,7 @@ public void Dispose() private class MyDevice : InputDevice { - public ButtonControl myControl { get; private set; } + public ButtonControl myControl { get; protected set; } protected override void FinishSetup() { diff --git a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs index fefa1dfced..bf78a3f705 100644 --- a/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs +++ b/Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.6.4 +// version 1.7.0 // from Assets/Tests/InputSystem/InputActionCodeGeneratorActions.inputactions // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs b/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs index 138e1a569b..f324a6eb07 100644 --- a/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs +++ b/Assets/Tests/InputSystem/Plugins/OnScreenTests.cs @@ -561,7 +561,7 @@ public void Devices_CanUseOnScreenButtonWithCustomDevice() public class CustomDevice : InputDevice { [InputControl] - public ButtonControl button { get; private set; } + public ButtonControl button { get; protected set; } protected override void FinishSetup() { diff --git a/Assets/Tests/InputSystem/Plugins/SteamTests.cs b/Assets/Tests/InputSystem/Plugins/SteamTests.cs index cc811dd52d..09a1039bc1 100644 --- a/Assets/Tests/InputSystem/Plugins/SteamTests.cs +++ b/Assets/Tests/InputSystem/Plugins/SteamTests.cs @@ -380,8 +380,8 @@ public FourCC format [InputControlLayout(stateType = typeof(TestControllerState))] class TestController : SteamController { - public ButtonControl fire { get; private set; } - public StickControl look { get; private set; } + public ButtonControl fire { get; protected set; } + public StickControl look { get; protected set; } public int updateCount; public int resolveActionsCount; diff --git a/Assets/Tests/InputSystem/Plugins/XRTests.cs b/Assets/Tests/InputSystem/Plugins/XRTests.cs index 55d2b782b7..66fc47062e 100644 --- a/Assets/Tests/InputSystem/Plugins/XRTests.cs +++ b/Assets/Tests/InputSystem/Plugins/XRTests.cs @@ -333,11 +333,11 @@ public void Layouts_ButtonsArePackedByTheByte_WhileLargerStructuresAreFourByteAl class TestHMD : UnityEngine.InputSystem.InputDevice { [InputControl] - public QuaternionControl rotation { get; private set; } + public QuaternionControl rotation { get; protected set; } [InputControl] - public Vector3Control position { get; private set; } + public Vector3Control position { get; protected set; } [InputControl] - public IntegerControl trackingState { get; private set; } + public IntegerControl trackingState { get; protected set; } protected override void FinishSetup() { base.FinishSetup(); @@ -351,9 +351,9 @@ protected override void FinishSetup() class TestHMDWithoutTrackingState : UnityEngine.InputSystem.InputDevice { [InputControl] - public QuaternionControl rotation { get; private set; } + public QuaternionControl rotation { get; protected set; } [InputControl] - public Vector3Control position { get; private set; } + public Vector3Control position { get; protected set; } protected override void FinishSetup() { base.FinishSetup(); diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 75e3e4b3a1..5d42de8189 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -23,6 +23,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed the `Clone` methods of `InputAction` and `InputActionMap` so it copies the Initial State Check flag (`InputAction.wantsInitialStateCheck`) of input actions. - Fixed the "Release tests throws exception in InputSystem" bug ([case ISXB-581](https://issuetracker.unity3d.com/issues/release-tests-fail-when-input-system-package-is-installed)). - Fixed issues with generating Precompiled Layouts for devices which are not defined in a namespace +- Fixed an issue where some controls like `QuaternionControl` could not be included in a Precompiled Layout because the generated code could not access a setter on child control properties. ## [1.6.3] - 2023-07-11 diff --git a/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs b/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs index 2491cf248a..1f1f45767b 100644 --- a/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs +++ b/Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs @@ -15,7 +15,7 @@ public static partial class InputSystem // Keep this in sync with "Packages/com.unity.inputsystem/package.json". // NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include // "-preview" suffixes here. - internal const string kAssemblyVersion = "1.6.4"; - internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.6"; + internal const string kAssemblyVersion = "1.7.0"; + internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.7"; } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/QuaternionControl.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/QuaternionControl.cs index c023b30a58..21081cf1b6 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/QuaternionControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/QuaternionControl.cs @@ -22,28 +22,28 @@ public class QuaternionControl : InputControl /// /// Control representing the X component. [InputControl(displayName = "X")] - public AxisControl x { get; private set; } + public AxisControl x { get; set; } /// /// The Y component of the quaternion. /// /// Control representing the Y component. [InputControl(displayName = "Y")] - public AxisControl y { get; private set; } + public AxisControl y { get; set; } /// /// The Z component of the quaternion. /// /// Control representing the Z component. [InputControl(displayName = "Z")] - public AxisControl z { get; private set; } + public AxisControl z { get; set; } /// /// The W component of the quaternion. /// /// Control representing the W component. [InputControl(displayName = "W")] - public AxisControl w { get; private set; } + public AxisControl w { get; set; } /// /// Default-initialize the control. diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs index 9a97ca0f73..bbd94e2467 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.6.4 +// version 1.7.0 // from "Keyboard" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs index 997ec37a8b..5a59181b3e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.6.4 +// version 1.7.0 // from "Mouse" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs index 50198e4c44..6d0f6ca270 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator -// version 1.6.4 +// version 1.7.0 // from "Touchscreen" layout // // Changes to this file may cause incorrect behavior and will be lost if diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs index 737425e619..39ccc82c1b 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Sensor.cs @@ -159,7 +159,7 @@ public float samplingFrequency [InputControlLayout(stateType = typeof(AccelerometerState))] public class Accelerometer : Sensor { - public Vector3Control acceleration { get; private set; } + public Vector3Control acceleration { get; protected set; } /// /// The accelerometer that was last added or had activity last. @@ -199,7 +199,7 @@ protected override void FinishSetup() [InputControlLayout(stateType = typeof(GyroscopeState))] public class Gyroscope : Sensor { - public Vector3Control angularVelocity { get; private set; } + public Vector3Control angularVelocity { get; protected set; } /// /// The gyroscope that was last added or had activity last. @@ -240,7 +240,7 @@ protected override void FinishSetup() [InputControlLayout(stateType = typeof(GravityState), displayName = "Gravity")] public class GravitySensor : Sensor { - public Vector3Control gravity { get; private set; } + public Vector3Control gravity { get; protected set; } /// /// The gravity sensor that was last added or had activity last. @@ -282,7 +282,7 @@ protected override void OnRemoved() [InputControlLayout(stateType = typeof(AttitudeState), displayName = "Attitude")] public class AttitudeSensor : Sensor { - public QuaternionControl attitude { get; private set; } + public QuaternionControl attitude { get; protected set; } /// /// The attitude sensor that was last added or had activity last. @@ -324,7 +324,7 @@ protected override void FinishSetup() [InputControlLayout(stateType = typeof(LinearAccelerationState), displayName = "Linear Acceleration")] public class LinearAccelerationSensor : Sensor { - public Vector3Control acceleration { get; private set; } + public Vector3Control acceleration { get; protected set; } /// /// The linear acceleration sensor that was last added or had activity last. @@ -369,7 +369,7 @@ public class MagneticFieldSensor : Sensor /// Values are in micro-Tesla (uT) and measure the ambient magnetic field in the X, Y and Z axis. /// [InputControl(displayName = "Magnetic Field", noisy = true)] - public Vector3Control magneticField { get; private set; } + public Vector3Control magneticField { get; protected set; } /// /// The linear acceleration sensor that was last added or had activity last. @@ -410,7 +410,7 @@ public class LightSensor : Sensor /// Light level in SI lux units. /// [InputControl(displayName = "Light Level", noisy = true)] - public AxisControl lightLevel { get; private set; } + public AxisControl lightLevel { get; protected set; } /// /// The light sensor that was last added or had activity last. @@ -451,7 +451,7 @@ public class PressureSensor : Sensor /// Atmospheric pressure in hPa (millibar). /// [InputControl(displayName = "Atmospheric Pressure", noisy = true)] - public AxisControl atmosphericPressure { get; private set; } + public AxisControl atmosphericPressure { get; protected set; } /// /// The pressure sensor that was last added or had activity last. @@ -495,7 +495,7 @@ public class ProximitySensor : Sensor /// Proximity sensor distance measured in centimeters. /// [InputControl(displayName = "Distance", noisy = true)] - public AxisControl distance { get; private set; } + public AxisControl distance { get; protected set; } /// /// The proximity sensor that was last added or had activity last. @@ -536,7 +536,7 @@ public class HumiditySensor : Sensor /// Relative ambient air humidity in percent. /// [InputControl(displayName = "Relative Humidity", noisy = true)] - public AxisControl relativeHumidity { get; private set; } + public AxisControl relativeHumidity { get; protected set; } /// /// The humidity sensor that was last added or had activity last. @@ -577,7 +577,7 @@ public class AmbientTemperatureSensor : Sensor /// Temperature in degree Celsius. /// [InputControl(displayName = "Ambient Temperature", noisy = true)] - public AxisControl ambientTemperature { get; private set; } + public AxisControl ambientTemperature { get; protected set; } /// /// The ambient temperature sensor that was last added or had activity last. @@ -621,7 +621,7 @@ public class StepCounter : Sensor /// The number of steps taken by the user since the last reboot while activated. /// [InputControl(displayName = "Step Counter", noisy = true)] - public IntegerControl stepCounter { get; private set; } + public IntegerControl stepCounter { get; protected set; } /// /// The step counter that was last added or had activity last. diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/TrackedDevice.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/TrackedDevice.cs index 029a1c5314..89153d282a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/TrackedDevice.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/TrackedDevice.cs @@ -13,13 +13,13 @@ namespace UnityEngine.InputSystem public class TrackedDevice : InputDevice { [InputControl(synthetic = true)] - public IntegerControl trackingState { get; private set; } + public IntegerControl trackingState { get; protected set; } [InputControl(synthetic = true)] - public ButtonControl isTracked { get; private set; } + public ButtonControl isTracked { get; protected set; } [InputControl(noisy = true, dontReset = true)] - public Vector3Control devicePosition { get; private set; } + public Vector3Control devicePosition { get; protected set; } [InputControl(noisy = true, dontReset = true)] - public QuaternionControl deviceRotation { get; private set; } + public QuaternionControl deviceRotation { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockGamepadHID.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockGamepadHID.cs index 3a71588778..9990208d54 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockGamepadHID.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockGamepadHID.cs @@ -968,9 +968,9 @@ public DualShock4HIDInputReport ToHIDInputReport() [InputControlLayout(stateType = typeof(DualShock3HIDInputReport), hideInUI = true, displayName = "PS3 Controller")] public class DualShock3GamepadHID : DualShockGamepad { - public ButtonControl leftTriggerButton { get; private set; } - public ButtonControl rightTriggerButton { get; private set; } - public ButtonControl playStationButton { get; private set; } + public ButtonControl leftTriggerButton { get; protected set; } + public ButtonControl rightTriggerButton { get; protected set; } + public ButtonControl playStationButton { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XInputController.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XInputController.cs index 7b63333828..fcaa117956 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XInputController.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XInputController.cs @@ -66,13 +66,13 @@ public class XInputController : Gamepad // This follows Xbox One conventions; on Xbox 360, this is start=start and select=back. [InputControl(name = "start", displayName = "Menu", alias = "menu")] [InputControl(name = "select", displayName = "View", alias = "view")] - public ButtonControl menu { get; private set; } + public ButtonControl menu { get; protected set; } /// /// Same as /// /// Same control as . - public ButtonControl view { get; private set; } + public ButtonControl view { get; protected set; } /// /// What specific kind of XInput controller this is. diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Controls/PoseControl.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Controls/PoseControl.cs index 915c5cb770..db4881f631 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Controls/PoseControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Controls/PoseControl.cs @@ -132,7 +132,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value. /// - public ButtonControl isTracked { get; private set; } + public ButtonControl isTracked { get; set; } /// /// The other controls on this that are currently reporting data. @@ -142,7 +142,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value of the pose retrieved from this control. /// - public IntegerControl trackingState { get; private set; } + public IntegerControl trackingState { get; set; } /// /// The position, in meters, of this tracked pose relative to the tracking origin. @@ -152,7 +152,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value of the pose retrieved from this control. /// - public Vector3Control position { get; private set; } + public Vector3Control position { get; set; } /// /// The rotation of this tracked pose relative to the tracking origin. @@ -162,7 +162,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value of the pose retrieved from this control. /// - public QuaternionControl rotation { get; private set; } + public QuaternionControl rotation { get; set; } /// /// The velocity, in meters per second, of this tracked pose relative to the tracking origin. @@ -172,7 +172,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value of the pose retrieved from this control. /// - public Vector3Control velocity { get; private set; } + public Vector3Control velocity { get; set; } /// /// The angular velocity of this tracked pose relative to the tracking origin. @@ -182,7 +182,7 @@ public class PoseControl : InputControl /// /// Control representing whether the pose is being fully tracked. Maps to the value of the pose retrieved from this control. /// - public Vector3Control angularVelocity { get; private set; } + public Vector3Control angularVelocity { get; set; } /// /// Default-initialize the pose control. diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs index f3c3b8ce91..a4dab309ff 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs @@ -22,27 +22,27 @@ public class DaydreamHMD : XRHMD public class DaydreamController : XRController { [InputControl] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } [InputControl] - public ButtonControl volumeUp { get; private set; } + public ButtonControl volumeUp { get; protected set; } [InputControl] - public ButtonControl recentered { get; private set; } + public ButtonControl recentered { get; protected set; } [InputControl] - public ButtonControl volumeDown { get; private set; } + public ButtonControl volumeDown { get; protected set; } [InputControl] - public ButtonControl recentering { get; private set; } + public ButtonControl recentering { get; protected set; } [InputControl] - public ButtonControl app { get; private set; } + public ButtonControl app { get; protected set; } [InputControl] - public ButtonControl home { get; private set; } + public ButtonControl home { get; protected set; } [InputControl] - public ButtonControl touchpadClicked { get; private set; } + public ButtonControl touchpadClicked { get; protected set; } [InputControl] - public ButtonControl touchpadTouched { get; private set; } + public ButtonControl touchpadTouched { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAcceleration { get; private set; } + public Vector3Control deviceAcceleration { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs index e76062c2c6..8267c728d5 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs @@ -17,31 +17,31 @@ public class OculusHMD : XRHMD [InputControl] [InputControl(name = "trackingState", layout = "Integer", aliases = new[] { "devicetrackingstate" })] [InputControl(name = "isTracked", layout = "Button", aliases = new[] { "deviceistracked" })] - public ButtonControl userPresence { get; private set; } + public ButtonControl userPresence { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAcceleration { get; private set; } + public Vector3Control deviceAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularAcceleration { get; private set; } + public Vector3Control deviceAngularAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control leftEyeAngularVelocity { get; private set; } + public Vector3Control leftEyeAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control leftEyeAcceleration { get; private set; } + public Vector3Control leftEyeAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control leftEyeAngularAcceleration { get; private set; } + public Vector3Control leftEyeAngularAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyeAngularVelocity { get; private set; } + public Vector3Control rightEyeAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyeAcceleration { get; private set; } + public Vector3Control rightEyeAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyeAngularAcceleration { get; private set; } + public Vector3Control rightEyeAngularAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyeAngularVelocity { get; private set; } + public Vector3Control centerEyeAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyeAcceleration { get; private set; } + public Vector3Control centerEyeAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyeAngularAcceleration { get; private set; } + public Vector3Control centerEyeAngularAcceleration { get; protected set; } protected override void FinishSetup() @@ -71,45 +71,45 @@ protected override void FinishSetup() public class OculusTouchController : XRControllerWithRumble { [InputControl(aliases = new[] { "Primary2DAxis", "Joystick" })] - public Vector2Control thumbstick { get; private set; } + public Vector2Control thumbstick { get; protected set; } [InputControl] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } [InputControl(aliases = new[] { "A", "X", "Alternate" })] - public ButtonControl primaryButton { get; private set; } + public ButtonControl primaryButton { get; protected set; } [InputControl(aliases = new[] { "B", "Y", "Primary" })] - public ButtonControl secondaryButton { get; private set; } + public ButtonControl secondaryButton { get; protected set; } [InputControl(aliases = new[] { "GripButton" })] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl] - public ButtonControl start { get; private set; } + public ButtonControl start { get; protected set; } [InputControl(aliases = new[] { "JoystickOrPadPressed", "thumbstickClick" })] - public ButtonControl thumbstickClicked { get; private set; } + public ButtonControl thumbstickClicked { get; protected set; } [InputControl(aliases = new[] { "ATouched", "XTouched", "ATouch", "XTouch" })] - public ButtonControl primaryTouched { get; private set; } + public ButtonControl primaryTouched { get; protected set; } [InputControl(aliases = new[] { "BTouched", "YTouched", "BTouch", "YTouch" })] - public ButtonControl secondaryTouched { get; private set; } + public ButtonControl secondaryTouched { get; protected set; } [InputControl(aliases = new[] { "indexTouch", "indexNearTouched" })] - public AxisControl triggerTouched { get; private set; } + public AxisControl triggerTouched { get; protected set; } [InputControl(aliases = new[] { "indexButton", "indexTouched" })] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl(aliases = new[] { "JoystickOrPadTouched", "thumbstickTouch" })] [InputControl(name = "trackingState", layout = "Integer", aliases = new[] { "controllerTrackingState" })] [InputControl(name = "isTracked", layout = "Button", aliases = new[] { "ControllerIsTracked" })] [InputControl(name = "devicePosition", layout = "Vector3", aliases = new[] { "controllerPosition" })] [InputControl(name = "deviceRotation", layout = "Quaternion", aliases = new[] { "controllerRotation" })] - public ButtonControl thumbstickTouched { get; private set; } + public ButtonControl thumbstickTouched { get; protected set; } [InputControl(noisy = true, aliases = new[] { "controllerVelocity" })] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true, aliases = new[] { "controllerAngularVelocity" })] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(noisy = true, aliases = new[] { "controllerAcceleration" })] - public Vector3Control deviceAcceleration { get; private set; } + public Vector3Control deviceAcceleration { get; protected set; } [InputControl(noisy = true, aliases = new[] { "controllerAngularAcceleration" })] - public Vector3Control deviceAngularAcceleration { get; private set; } + public Vector3Control deviceAngularAcceleration { get; protected set; } protected override void FinishSetup() { @@ -140,9 +140,9 @@ protected override void FinishSetup() public class OculusTrackingReference : TrackedDevice { [InputControl(aliases = new[] { "trackingReferenceTrackingState" })] - public new IntegerControl trackingState { get; private set; } + public new IntegerControl trackingState { get; protected set; } [InputControl(aliases = new[] { "trackingReferenceIsTracked" })] - public new ButtonControl isTracked { get; private set; } + public new ButtonControl isTracked { get; protected set; } protected override void FinishSetup() { @@ -160,11 +160,11 @@ protected override void FinishSetup() public class OculusRemote : InputDevice { [InputControl] - public ButtonControl back { get; private set; } + public ButtonControl back { get; protected set; } [InputControl] - public ButtonControl start { get; private set; } + public ButtonControl start { get; protected set; } [InputControl] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } protected override void FinishSetup() { @@ -183,9 +183,9 @@ protected override void FinishSetup() public class OculusHMDExtended : OculusHMD { [InputControl] - public ButtonControl back { get; private set; } + public ButtonControl back { get; protected set; } [InputControl] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } protected override void FinishSetup() { @@ -203,23 +203,23 @@ protected override void FinishSetup() public class GearVRTrackedController : XRController { [InputControl] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } [InputControl] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl] - public ButtonControl back { get; private set; } + public ButtonControl back { get; protected set; } [InputControl] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl] - public ButtonControl touchpadClicked { get; private set; } + public ButtonControl touchpadClicked { get; protected set; } [InputControl] - public ButtonControl touchpadTouched { get; private set; } + public ButtonControl touchpadTouched { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAcceleration { get; private set; } + public Vector3Control deviceAcceleration { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularAcceleration { get; private set; } + public Vector3Control deviceAngularAcceleration { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs index 8a3cc45f07..c109b57989 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs @@ -12,21 +12,21 @@ namespace Unity.XR.OpenVR public class OpenVRHMD : XRHMD { [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control leftEyeVelocity { get; private set; } + public Vector3Control leftEyeVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control leftEyeAngularVelocity { get; private set; } + public Vector3Control leftEyeAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyeVelocity { get; private set; } + public Vector3Control rightEyeVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyeAngularVelocity { get; private set; } + public Vector3Control rightEyeAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyeVelocity { get; private set; } + public Vector3Control centerEyeVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyeAngularVelocity { get; private set; } + public Vector3Control centerEyeAngularVelocity { get; protected set; } protected override void FinishSetup() { @@ -47,30 +47,30 @@ protected override void FinishSetup() public class OpenVRControllerWMR : XRController { [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisClick", "joystickOrPadPressed" })] - public ButtonControl touchpadClick { get; private set; } + public ButtonControl touchpadClick { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisTouch", "joystickOrPadTouched" })] - public ButtonControl touchpadTouch { get; private set; } + public ButtonControl touchpadTouch { get; protected set; } [InputControl] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl(aliases = new[] { "primary" })] - public ButtonControl menu { get; private set; } + public ButtonControl menu { get; protected set; } [InputControl] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } [InputControl(aliases = new[] { "secondary2DAxis" })] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } [InputControl(aliases = new[] { "primary2DAxis" })] - public Vector2Control joystick { get; private set; } + public Vector2Control joystick { get; protected set; } protected override void FinishSetup() { @@ -100,26 +100,26 @@ protected override void FinishSetup() public class ViveWand : XRControllerWithRumble { [InputControl] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } [InputControl] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl] - public ButtonControl primary { get; private set; } + public ButtonControl primary { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisClick", "joystickOrPadPressed" })] - public ButtonControl trackpadPressed { get; private set; } + public ButtonControl trackpadPressed { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisTouch", "joystickOrPadTouched" })] - public ButtonControl trackpadTouched { get; private set; } + public ButtonControl trackpadTouched { get; protected set; } [InputControl(aliases = new[] { "Primary2DAxis" })] - public Vector2Control trackpad { get; private set; } + public Vector2Control trackpad { get; protected set; } [InputControl] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } protected override void FinishSetup() { @@ -154,9 +154,9 @@ public class ViveLighthouse : TrackedDevice public class ViveTracker : TrackedDevice { [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } protected override void FinishSetup() { @@ -171,15 +171,15 @@ protected override void FinishSetup() public class HandedViveTracker : ViveTracker { [InputControl] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } [InputControl] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl] - public ButtonControl primary { get; private set; } + public ButtonControl primary { get; protected set; } [InputControl(aliases = new[] { "JoystickOrPadPressed" })] - public ButtonControl trackpadPressed { get; private set; } + public ButtonControl trackpadPressed { get; protected set; } [InputControl] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } protected override void FinishSetup() { @@ -200,32 +200,32 @@ protected override void FinishSetup() public class OpenVROculusTouchController : XRControllerWithRumble { [InputControl] - public Vector2Control thumbstick { get; private set; } + public Vector2Control thumbstick { get; protected set; } [InputControl] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } // Primary & Secondary are switched in order to retain consistency with the Oculus SDK [InputControl(aliases = new[] { "Alternate" })] - public ButtonControl primaryButton { get; private set; } + public ButtonControl primaryButton { get; protected set; } [InputControl(aliases = new[] { "Primary" })] - public ButtonControl secondaryButton { get; private set; } + public ButtonControl secondaryButton { get; protected set; } [InputControl] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisClicked" })] - public ButtonControl thumbstickClicked { get; private set; } + public ButtonControl thumbstickClicked { get; protected set; } [InputControl(aliases = new[] { "primary2DAxisTouch" })] - public ButtonControl thumbstickTouched { get; private set; } + public ButtonControl thumbstickTouched { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true)] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs index 7a5d9080f7..d018cd5f0a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs @@ -16,7 +16,7 @@ public class WMRHMD : XRHMD [InputControl] [InputControl(name = "devicePosition", layout = "Vector3", aliases = new[] { "HeadPosition" })] [InputControl(name = "deviceRotation", layout = "Quaternion", aliases = new[] { "HeadRotation" })] - public ButtonControl userPresence { get; private set; } + public ButtonControl userPresence { get; protected set; } protected override void FinishSetup() { @@ -33,13 +33,13 @@ protected override void FinishSetup() public class HololensHand : XRController { [InputControl(noisy = true, aliases = new[] { "gripVelocity" })] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(aliases = new[] { "triggerbutton" })] - public ButtonControl airTap { get; private set; } + public ButtonControl airTap { get; protected set; } [InputControl(noisy = true)] - public AxisControl sourceLossRisk { get; private set; } + public AxisControl sourceLossRisk { get; protected set; } [InputControl(noisy = true)] - public Vector3Control sourceLossMitigationDirection { get; private set; } + public Vector3Control sourceLossMitigationDirection { get; protected set; } protected override void FinishSetup() { @@ -56,40 +56,40 @@ protected override void FinishSetup() public class WMRSpatialController : XRControllerWithRumble { [InputControl(aliases = new[] { "Primary2DAxis", "thumbstickaxes" })] - public Vector2Control joystick { get; private set; } + public Vector2Control joystick { get; protected set; } [InputControl(aliases = new[] { "Secondary2DAxis", "touchpadaxes" })] - public Vector2Control touchpad { get; private set; } + public Vector2Control touchpad { get; protected set; } [InputControl(aliases = new[] { "gripaxis" })] - public AxisControl grip { get; private set; } + public AxisControl grip { get; protected set; } [InputControl(aliases = new[] { "gripbutton" })] - public ButtonControl gripPressed { get; private set; } + public ButtonControl gripPressed { get; protected set; } [InputControl(aliases = new[] { "Primary", "menubutton" })] - public ButtonControl menu { get; private set; } + public ButtonControl menu { get; protected set; } [InputControl(aliases = new[] { "triggeraxis" })] - public AxisControl trigger { get; private set; } + public AxisControl trigger { get; protected set; } [InputControl(aliases = new[] { "triggerbutton" })] - public ButtonControl triggerPressed { get; private set; } + public ButtonControl triggerPressed { get; protected set; } [InputControl(aliases = new[] { "thumbstickpressed" })] - public ButtonControl joystickClicked { get; private set; } + public ButtonControl joystickClicked { get; protected set; } [InputControl(aliases = new[] { "joystickorpadpressed", "touchpadpressed" })] - public ButtonControl touchpadClicked { get; private set; } + public ButtonControl touchpadClicked { get; protected set; } [InputControl(aliases = new[] { "joystickorpadtouched", "touchpadtouched" })] - public ButtonControl touchpadTouched { get; private set; } + public ButtonControl touchpadTouched { get; protected set; } [InputControl(noisy = true, aliases = new[] { "gripVelocity" })] - public Vector3Control deviceVelocity { get; private set; } + public Vector3Control deviceVelocity { get; protected set; } [InputControl(noisy = true, aliases = new[] { "gripAngularVelocity" })] - public Vector3Control deviceAngularVelocity { get; private set; } + public Vector3Control deviceAngularVelocity { get; protected set; } [InputControl(noisy = true)] - public AxisControl batteryLevel { get; private set; } + public AxisControl batteryLevel { get; protected set; } [InputControl(noisy = true)] - public AxisControl sourceLossRisk { get; private set; } + public AxisControl sourceLossRisk { get; protected set; } [InputControl(noisy = true)] - public Vector3Control sourceLossMitigationDirection { get; private set; } + public Vector3Control sourceLossMitigationDirection { get; protected set; } [InputControl(noisy = true)] - public Vector3Control pointerPosition { get; private set; } + public Vector3Control pointerPosition { get; protected set; } [InputControl(noisy = true, aliases = new[] { "PointerOrientation" })] - public QuaternionControl pointerRotation { get; private set; } + public QuaternionControl pointerRotation { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs index 25f933d1c3..cfbbb51f0a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs @@ -35,17 +35,17 @@ public class XRHMD : TrackedDevice /// [InputControl(noisy = true)] - public Vector3Control leftEyePosition { get; private set; } + public Vector3Control leftEyePosition { get; protected set; } [InputControl(noisy = true)] - public QuaternionControl leftEyeRotation { get; private set; } + public QuaternionControl leftEyeRotation { get; protected set; } [InputControl(noisy = true)] - public Vector3Control rightEyePosition { get; private set; } + public Vector3Control rightEyePosition { get; protected set; } [InputControl(noisy = true)] - public QuaternionControl rightEyeRotation { get; private set; } + public QuaternionControl rightEyeRotation { get; protected set; } [InputControl(noisy = true)] - public Vector3Control centerEyePosition { get; private set; } + public Vector3Control centerEyePosition { get; protected set; } [InputControl(noisy = true)] - public QuaternionControl centerEyeRotation { get; private set; } + public QuaternionControl centerEyeRotation { get; protected set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs index db64d4ee82..bcf3818581 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs @@ -283,11 +283,11 @@ public float rightEyeOpenAmount public class BoneControl : InputControl { [InputControl(offset = 0, displayName = "parentBoneIndex")] - public IntegerControl parentBoneIndex { get; private set; } + public IntegerControl parentBoneIndex { get; set; } [InputControl(offset = 4, displayName = "Position")] - public Vector3Control position { get; private set; } + public Vector3Control position { get; set; } [InputControl(offset = 16, displayName = "Rotation")] - public QuaternionControl rotation { get; private set; } + public QuaternionControl rotation { get; set; } protected override void FinishSetup() { @@ -319,19 +319,19 @@ public override unsafe void WriteValueIntoState(Bone value, void* statePtr) public class EyesControl : InputControl { [InputControl(offset = 0, displayName = "LeftEyePosition")] - public Vector3Control leftEyePosition { get; private set; } + public Vector3Control leftEyePosition { get; set; } [InputControl(offset = 12, displayName = "LeftEyeRotation")] - public QuaternionControl leftEyeRotation { get; private set; } + public QuaternionControl leftEyeRotation { get; set; } [InputControl(offset = 28, displayName = "RightEyePosition")] - public Vector3Control rightEyePosition { get; private set; } + public Vector3Control rightEyePosition { get; set; } [InputControl(offset = 40, displayName = "RightEyeRotation")] - public QuaternionControl rightEyeRotation { get; private set; } + public QuaternionControl rightEyeRotation { get; set; } [InputControl(offset = 56, displayName = "FixationPoint")] - public Vector3Control fixationPoint { get; private set; } + public Vector3Control fixationPoint { get; set; } [InputControl(offset = 68, displayName = "LeftEyeOpenAmount")] - public AxisControl leftEyeOpenAmount { get; private set; } + public AxisControl leftEyeOpenAmount { get; set; } [InputControl(offset = 72, displayName = "RightEyeOpenAmount")] - public AxisControl rightEyeOpenAmount { get; private set; } + public AxisControl rightEyeOpenAmount { get; set; } protected override void FinishSetup() { diff --git a/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs b/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs index 2ff6a3f872..55ebaa2595 100644 --- a/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs +++ b/Packages/com.unity.inputsystem/Tests/TestFixture/AssemblyInfo.cs @@ -4,7 +4,7 @@ // Keep this in sync with "Packages/com.unity.inputsystem/package.json". // NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include // "-preview" suffixes here. -[assembly: AssemblyVersion("1.6.4")] +[assembly: AssemblyVersion("1.7.0")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests.Editor")] [assembly: InternalsVisibleTo("Unity.InputSystem.Tests")] [assembly: InternalsVisibleTo("Unity.InputSystem.IntegrationTests")] diff --git a/Packages/com.unity.inputsystem/ValidationExceptions.json b/Packages/com.unity.inputsystem/ValidationExceptions.json index 5a6eb937ef..9128292b92 100644 --- a/Packages/com.unity.inputsystem/ValidationExceptions.json +++ b/Packages/com.unity.inputsystem/ValidationExceptions.json @@ -1,9 +1,4 @@ { - "ErrorExceptions": [ - { - "ValidationTest": "API Updater Configuration Validation", - "PackageVersion": "1.6.4" - } - ], + "ErrorExceptions": [], "WarningExceptions": [] } diff --git a/Packages/com.unity.inputsystem/package.json b/Packages/com.unity.inputsystem/package.json index 906f8b8dc0..8428aa9ce8 100755 --- a/Packages/com.unity.inputsystem/package.json +++ b/Packages/com.unity.inputsystem/package.json @@ -1,7 +1,7 @@ { "name": "com.unity.inputsystem", "displayName": "Input System", - "version": "1.6.4", + "version": "1.7.0", "unity": "2019.4", "description": "A new input system which can be used as a more extensible and customizable alternative to Unity's classic input system in UnityEngine.Input.", "keywords": [ diff --git a/ProjectSettings/Packages/com.unity.probuilder/Settings.json b/ProjectSettings/Packages/com.unity.probuilder/Settings.json index eaf34fe5f7..92eed6a828 100644 --- a/ProjectSettings/Packages/com.unity.probuilder/Settings.json +++ b/ProjectSettings/Packages/com.unity.probuilder/Settings.json @@ -93,11 +93,6 @@ "key": "mesh.userMaterial", "value": "{\"m_Value\":{\"instanceID\":0}}" }, - { - "type": "UnityEditor.StaticEditorFlags, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", - "key": "mesh.defaultStaticEditorFlags", - "value": "{\"m_Value\":0}" - }, { "type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "key": "mesh.newShapePivotLocation",