From 4498f0679e0cf20f2fbe17ca017abf2db3044c03 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 12:24:34 +0300 Subject: [PATCH 1/7] remove direct mentions of pre 2022.3 lts stuff --- .../Editor/InputSystemPluginControl.cs | 4 ---- .../Plugins/UI/ExtendedPointerEventData.cs | 8 ------- .../Plugins/UI/InputSystemUIInputModule.cs | 23 +------------------ .../Plugins/XInput/XboxGamepadMacOS.cs | 17 -------------- 4 files changed, 1 insertion(+), 51 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/InputSystemPluginControl.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/InputSystemPluginControl.cs index 78e01768e1..12f4c961c9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/InputSystemPluginControl.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/InputSystemPluginControl.cs @@ -37,12 +37,8 @@ private static void CheckForExtension() BuildTarget.tvOS, BuildTarget.LinuxHeadlessSimulation, BuildTarget.EmbeddedLinux, - #if UNITY_2022_1_OR_NEWER BuildTarget.QNX, - #endif - #if UNITY_2022_3_OR_NEWER BuildTarget.VisionOS, - #endif (BuildTarget)49, BuildTarget.NoTarget }; diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/ExtendedPointerEventData.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/ExtendedPointerEventData.cs index 736d65b34a..f36f79f49a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/ExtendedPointerEventData.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/ExtendedPointerEventData.cs @@ -94,9 +94,7 @@ public override string ToString() stringBuilder.AppendLine("azimuthAngle: " + azimuthAngle); stringBuilder.AppendLine("altitudeAngle: " + altitudeAngle); stringBuilder.AppendLine("twist: " + twist); - #if UNITY_2022_3_OR_NEWER stringBuilder.AppendLine("displayIndex: " + displayIndex); - #endif return stringBuilder.ToString(); } @@ -138,27 +136,21 @@ internal void ReadDeviceState() azimuthAngle = (pen.tilt.value.x + 1) * Mathf.PI / 2; altitudeAngle = (pen.tilt.value.y + 1) * Mathf.PI / 2; twist = pen.twist.value * Mathf.PI * 2; - #if UNITY_2022_3_OR_NEWER displayIndex = pen.displayIndex.ReadValue(); - #endif } else if (control.parent is TouchControl touchControl) { uiToolkitPointerId = GetTouchPointerId(touchControl); pressure = touchControl.pressure.magnitude; radius = touchControl.radius.value; - #if UNITY_2022_3_OR_NEWER displayIndex = touchControl.displayIndex.ReadValue(); - #endif } else if (control.parent is Touchscreen touchscreen) { uiToolkitPointerId = GetTouchPointerId(touchscreen.primaryTouch); pressure = touchscreen.pressure.magnitude; radius = touchscreen.radius.value; - #if UNITY_2022_3_OR_NEWER displayIndex = touchscreen.displayIndex.ReadValue(); - #endif } else { diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs index b2e06a010a..096bbe33e3 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs @@ -579,9 +579,8 @@ private void ProcessPointerMovement(ExtendedPointerEventData eventData, GameObje if (!sendPointerHoverToParent && current == pointerParent) break; -#if UNITY_2021_3_OR_NEWER eventData.fullyExited = current != commonRoot && eventData.pointerEnter != currentPointerTarget; -#endif + ExecuteEvents.Execute(current.gameObject, eventData, ExecuteEvents.pointerExitHandler); eventData.hovered.Remove(current.gameObject); @@ -605,12 +604,10 @@ private void ProcessPointerMovement(ExtendedPointerEventData eventData, GameObje Transform current = currentPointerTarget.transform; while (current != null && !PointerShouldIgnoreTransform(current)) { -#if UNITY_2021_3_OR_NEWER eventData.reentered = current == commonRoot && current != oldPointerEnter; // if we are sending the event to parent, they are already in hover mode at that point. No need to bubble up the event. if (sendPointerHoverToParent && eventData.reentered) break; -#endif ExecuteEvents.Execute(current.gameObject, eventData, ExecuteEvents.pointerEnterHandler); if (wasMoved) @@ -1926,9 +1923,7 @@ private int GetPointerStateIndexFor(InputControl control, bool createIfNotExists eventData.pointerType = pointerType; eventData.pointerId = pointerId; eventData.touchId = touchId; -#if UNITY_2022_3_OR_NEWER eventData.displayIndex = displayIndex; -#endif // Make sure these don't linger around when we switch to a different kind of pointer. eventData.trackedDeviceOrientation = default; @@ -2031,9 +2026,7 @@ private int AllocatePointer(int pointerId, int displayIndex, int touchId, UIPoin eventData = new ExtendedPointerEventData(eventSystem); eventData.pointerId = pointerId; -#if UNITY_2022_3_OR_NEWER eventData.displayIndex = displayIndex; -#endif eventData.touchId = touchId; eventData.pointerType = pointerType; eventData.control = control; @@ -2164,9 +2157,7 @@ private void OnPointCallback(InputAction.CallbackContext context) ref var state = ref GetPointerStateForIndex(index); state.screenPosition = context.ReadValue(); -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } // NOTE: In the click events, we specifically react to the Canceled phase to make sure we do NOT perform @@ -2195,9 +2186,7 @@ private void OnLeftClickCallback(InputAction.CallbackContext context) state.changedThisFrame = true; if (IgnoreNextClick(ref context, wasPressed)) state.leftButton.ignoreNextClick = true; -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private void OnRightClickCallback(InputAction.CallbackContext context) @@ -2212,9 +2201,7 @@ private void OnRightClickCallback(InputAction.CallbackContext context) state.changedThisFrame = true; if (IgnoreNextClick(ref context, wasPressed)) state.rightButton.ignoreNextClick = true; -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private void OnMiddleClickCallback(InputAction.CallbackContext context) @@ -2229,9 +2216,7 @@ private void OnMiddleClickCallback(InputAction.CallbackContext context) state.changedThisFrame = true; if (IgnoreNextClick(ref context, wasPressed)) state.middleButton.ignoreNextClick = true; -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private bool CheckForRemovedDevice(ref InputAction.CallbackContext context) @@ -2261,9 +2246,7 @@ private void OnScrollCallback(InputAction.CallbackContext context) // ISXB-704: convert input value to BaseInputModule convention. state.scrollDelta = (scrollDelta / InputSystem.scrollWheelDeltaPerTick) * scrollDeltaPerTick; -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private void OnMoveCallback(InputAction.CallbackContext context) @@ -2286,9 +2269,7 @@ private void OnTrackedDeviceOrientationCallback(InputAction.CallbackContext cont ref var state = ref GetPointerStateForIndex(index); state.worldOrientation = context.ReadValue(); -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private void OnTrackedDevicePositionCallback(InputAction.CallbackContext context) @@ -2299,9 +2280,7 @@ private void OnTrackedDevicePositionCallback(InputAction.CallbackContext context ref var state = ref GetPointerStateForIndex(index); state.worldPosition = context.ReadValue(); -#if UNITY_2022_3_OR_NEWER state.eventData.displayIndex = GetDisplayIndexFor(context.control); -#endif } private void OnControlsChanged(object obj) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs index ed5e870044..5161b35857 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XInput/XboxGamepadMacOS.cs @@ -127,12 +127,6 @@ public enum Button RightThumbstickPress = 15, } - // IL2CPP on 2021 doesn't respect the FieldOffsets - as such, we need some padding fields -#if UNITY_2021 && ENABLE_IL2CPP - [FieldOffset(0)] - private uint padding; -#endif - [InputControl(name = "buttonSouth", bit = (uint)Button.A, displayName = "A")] [InputControl(name = "buttonEast", bit = (uint)Button.B, displayName = "B")] [InputControl(name = "buttonWest", bit = (uint)Button.X, displayName = "X")] @@ -154,20 +148,9 @@ public enum Button [InputControl(name = "leftTrigger", format = "BYTE")] [FieldOffset(6)] public byte leftTrigger; -#if UNITY_2021 && ENABLE_IL2CPP - [FieldOffset(7)] - private byte triggerPadding; -#endif - [InputControl(name = "rightTrigger", format = "BYTE")] [FieldOffset(8)] public byte rightTrigger; -#if UNITY_2021 && ENABLE_IL2CPP - [FieldOffset(9)] - private byte triggerPadding2; -#endif - - [InputControl(name = "leftStick", layout = "Stick", format = "VC2S")] [InputControl(name = "leftStick/x", offset = 0, format = "SHRT", parameters = "")] [InputControl(name = "leftStick/left", offset = 0, format = "SHRT", parameters = "")] From 77410beb81db3c03e3c461c1bd41bb5e9bcacdc9 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 12:35:08 +0300 Subject: [PATCH 2/7] transform.SetPositionAndRotation is always available these days --- .../Plugins/XR/TrackedPoseDriver.cs | 38 +++++++++---------- .../InputSystem/Unity.InputSystem.asmdef | 15 -------- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs index affde24152..8b3fa012cd 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs @@ -587,26 +587,26 @@ protected virtual void SetLocalTransform(Vector3 newPosition, Quaternion newRota var positionValid = m_IgnoreTrackingState || (m_CurrentTrackingState & TrackingStates.Position) != 0; var rotationValid = m_IgnoreTrackingState || (m_CurrentTrackingState & TrackingStates.Rotation) != 0; -#if HAS_SET_LOCAL_POSITION_AND_ROTATION - if (m_TrackingType == TrackingType.RotationAndPosition && rotationValid && positionValid) + switch (m_TrackingType) { - transform.SetLocalPositionAndRotation(newPosition, newRotation); - return; - } -#endif - - if (rotationValid && - (m_TrackingType == TrackingType.RotationAndPosition || - m_TrackingType == TrackingType.RotationOnly)) - { - transform.localRotation = newRotation; - } - - if (positionValid && - (m_TrackingType == TrackingType.RotationAndPosition || - m_TrackingType == TrackingType.PositionOnly)) - { - transform.localPosition = newPosition; + case TrackingType.RotationAndPosition: + if (rotationValid && positionValid) + transform.SetLocalPositionAndRotation(newPosition, newRotation); + else if (rotationValid) + transform.localRotation = newRotation; + else + transform.localPosition = newPosition; + break; + + case TrackingType.PositionOnly: + if (positionValid) + transform.localPosition = newPosition; + break; + + case TrackingType.RotationOnly: + if (rotationValid) + transform.localRotation = newRotation; + break; } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef index bd5b6f0af4..253ad9c2f9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef +++ b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef @@ -52,21 +52,6 @@ "expression": "1.0.0", "define": "UNITY_INPUT_SYSTEM_ENABLE_UI" }, - { - "name": "Unity", - "expression": "[2021.3.11,2022.1)", - "define": "HAS_SET_LOCAL_POSITION_AND_ROTATION" - }, - { - "name": "Unity", - "expression": "[2022.1.19,2022.2)", - "define": "HAS_SET_LOCAL_POSITION_AND_ROTATION" - }, - { - "name": "Unity", - "expression": "2022.2", - "define": "HAS_SET_LOCAL_POSITION_AND_ROTATION" - }, { "name": "Unity", "expression": "2022.3", From 926589a2a851451d8fd9488a1141169ec6b4246a Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 13:09:36 +0300 Subject: [PATCH 3/7] remove support for the Daydream controller (deprecated in October 2020) --- .../Plugins/XR/Devices/GoogleVR.cs | 64 ------------------- .../Plugins/XR/Devices/GoogleVR.cs.meta | 11 ---- .../InputSystem/Plugins/XR/XRSupport.cs | 12 ---- .../InputSystem/Unity.InputSystem.asmdef | 5 -- 4 files changed, 92 deletions(-) delete mode 100644 Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs delete mode 100644 Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs deleted file mode 100644 index ca156f0a8c..0000000000 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs +++ /dev/null @@ -1,64 +0,0 @@ -#if !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR -// Docs generation is skipped because these are intended to be replaced with the com.unity.xr.googlevr package. -using UnityEngine.InputSystem.Controls; -using UnityEngine.InputSystem.Layouts; -using UnityEngine.InputSystem.XR; - -namespace Unity.XR.GoogleVr -{ - /// - /// A head-mounted display powered by Google Daydream. - /// - [InputControlLayout(displayName = "Daydream Headset", hideInUI = true)] - public class DaydreamHMD : XRHMD - { - } - - /// - /// An XR controller powered by Google Daydream. - /// - [InputControlLayout(displayName = "Daydream Controller", commonUsages = new[] { "LeftHand", "RightHand" }, hideInUI = true)] - public class DaydreamController : XRController - { - [InputControl] - public Vector2Control touchpad { get; protected set; } - [InputControl] - public ButtonControl volumeUp { get; protected set; } - [InputControl] - public ButtonControl recentered { get; protected set; } - [InputControl] - public ButtonControl volumeDown { get; protected set; } - [InputControl] - public ButtonControl recentering { get; protected set; } - [InputControl] - public ButtonControl app { get; protected set; } - [InputControl] - public ButtonControl home { get; protected set; } - [InputControl] - public ButtonControl touchpadClicked { get; protected set; } - [InputControl] - public ButtonControl touchpadTouched { get; protected set; } - [InputControl(noisy = true)] - public Vector3Control deviceVelocity { get; protected set; } - [InputControl(noisy = true)] - public Vector3Control deviceAcceleration { get; protected set; } - - protected override void FinishSetup() - { - base.FinishSetup(); - - touchpad = GetChildControl("touchpad"); - volumeUp = GetChildControl("volumeUp"); - recentered = GetChildControl("recentered"); - volumeDown = GetChildControl("volumeDown"); - recentering = GetChildControl("recentering"); - app = GetChildControl("app"); - home = GetChildControl("home"); - touchpadClicked = GetChildControl("touchpadClicked"); - touchpadTouched = GetChildControl("touchpadTouched"); - deviceVelocity = GetChildControl("deviceVelocity"); - deviceAcceleration = GetChildControl("deviceAcceleration"); - } - } -} -#endif diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta deleted file mode 100644 index b65525d7c9..0000000000 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 44353112a58c73347adde914844b7642 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs index 3b26aa6be9..4dfbd1374d 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs @@ -450,18 +450,6 @@ public static void Initialize() .WithProduct("^(Oculus Tracked Remote)")); #endif - // Built-in layouts replaced by the com.unity.xr.googlevr package. -#if !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR - InputSystem.RegisterLayout( - matches: new InputDeviceMatcher() - .WithInterface(XRUtilities.InterfaceMatchAnyVersion) - .WithProduct("Daydream HMD")); - InputSystem.RegisterLayout( - matches: new InputDeviceMatcher() - .WithInterface(XRUtilities.InterfaceMatchAnyVersion) - .WithProduct("^(Daydream Controller)")); -#endif - // Built-in layouts replaced by the com.unity.xr.openvr package. #if !DISABLE_BUILTIN_INPUT_SYSTEM_OPENVR InputSystem.RegisterLayout( diff --git a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef index 253ad9c2f9..d2f38a6a50 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef +++ b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef @@ -17,11 +17,6 @@ "expression": "1.0.3", "define": "DISABLE_BUILTIN_INPUT_SYSTEM_OCULUS" }, - { - "name": "com.unity.xr.googlevr", - "expression": "1.0.0", - "define": "DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR" - }, { "name": "com.unity.xr.openvr", "expression": "1.0.0", From fe900b34b908d300e7c45fc50b246c5fb676de9e Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 13:39:38 +0300 Subject: [PATCH 4/7] roll back a temporary fix that we allegedly no longer need in 2022.3 LTS (case UUM-10774) --- .../DeviceSimulator/InputSystemPlugin.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs index 39de5482ad..a15ee4799c 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs @@ -12,7 +12,6 @@ internal class InputSystemPlugin : DeviceSimulatorPlugin internal Touchscreen SimulatorTouchscreen; private bool m_InputSystemEnabled; - private bool m_Quitting; private List m_DisabledDevices; public override string title => "Input System"; @@ -22,9 +21,6 @@ public override void OnCreate() m_InputSystemEnabled = EditorPlayerSettingHelpers.newSystemBackendsEnabled; if (m_InputSystemEnabled) { - // Monitor whether the editor is quitting to avoid risking unsafe EnableDevice while quitting - UnityEditor.EditorApplication.quitting += OnQuitting; - m_DisabledDevices = new List(); // deviceSimulator is never null when the plugin is instantiated by a simulator window, but it can be null during unit tests @@ -99,27 +95,15 @@ public override void OnDestroy() deviceSimulator.touchScreenInput -= OnTouchEvent; InputSystem.onDeviceChange -= OnDeviceChange; - UnityEditor.EditorApplication.quitting -= OnQuitting; - if (SimulatorTouchscreen != null) InputSystem.RemoveDevice(SimulatorTouchscreen); foreach (var device in m_DisabledDevices) { - // Note that m_Quitting is used here to mitigate the problem reported in issue tracker: - // https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-10774. - // Enabling a device will call into IOCTL of backend which will (may) be destroyed prior - // to this callback on Unity version <= 2022.2. This is not a fix for the actual problem - // of shutdown order but a package fix to mitigate this problem. - if (device.added && !m_Quitting) + if (device.added) InputSystem.EnableDevice(device); } } } - - private void OnQuitting() - { - m_Quitting = true; - } } } From fda63bcdf49a441794558732f31920f45e92e559 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 13:52:10 +0300 Subject: [PATCH 5/7] update release notes --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index a771fcba2f..a0c863fce2 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -14,6 +14,7 @@ however, it has to be formatted properly to pass verification tests. - Replaced "Look" rebinding button for "Keyboard" control scheme with a mouse sensitivity slider in `RebindingUISample` to illustrate how to support customizing scaling of mouse deltas and how to reapply the persisted setting between runs. - Changed: Input System no longer depends the obsolete com.unity.modules.vr package. - Removed code that had to do with Unity versions older than Unity 2021.3 LTS. +- Removed code that had to do with Unity versions older than Unity 2022.3 LTS. ### Added - Added an example of how to swap two similar controls to the `RebindingUISample`. This is accessible via a button with two arrows at the right hand-side of the screen. Pressing the button allows swapping the current bindings of the "Move" and "Look" gamepad bindings via the new `RebindActionUI.SwapBinding(RebindActionUI other)` method. From 30eb8e63bc2790057912acbde53a37b35e71d26f Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Wed, 5 Nov 2025 13:54:31 +0300 Subject: [PATCH 6/7] Apply suggestion from @u-pr-agent[bot] Co-authored-by: u-pr-agent[bot] <205906871+u-pr-agent[bot]@users.noreply.github.com> --- .../InputSystem/Plugins/XR/TrackedPoseDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs index 8b3fa012cd..54d24cad9f 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs @@ -594,7 +594,7 @@ protected virtual void SetLocalTransform(Vector3 newPosition, Quaternion newRota transform.SetLocalPositionAndRotation(newPosition, newRotation); else if (rotationValid) transform.localRotation = newRotation; - else + else if (positionValid) transform.localPosition = newPosition; break; From e74cf8eed3ee1acba10876d75a168cfc0c7e0b62 Mon Sep 17 00:00:00 2001 From: Anthony Yakovlev Date: Thu, 6 Nov 2025 11:27:32 +0300 Subject: [PATCH 7/7] Revert "remove support for the Daydream controller (deprecated in October 2020)" This reverts commit 926589a2a851451d8fd9488a1141169ec6b4246a. --- .../Plugins/XR/Devices/GoogleVR.cs | 64 +++++++++++++++++++ .../Plugins/XR/Devices/GoogleVR.cs.meta | 11 ++++ .../InputSystem/Plugins/XR/XRSupport.cs | 12 ++++ .../InputSystem/Unity.InputSystem.asmdef | 5 ++ 4 files changed, 92 insertions(+) create mode 100644 Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs create mode 100644 Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs new file mode 100644 index 0000000000..ca156f0a8c --- /dev/null +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs @@ -0,0 +1,64 @@ +#if !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR +// Docs generation is skipped because these are intended to be replaced with the com.unity.xr.googlevr package. +using UnityEngine.InputSystem.Controls; +using UnityEngine.InputSystem.Layouts; +using UnityEngine.InputSystem.XR; + +namespace Unity.XR.GoogleVr +{ + /// + /// A head-mounted display powered by Google Daydream. + /// + [InputControlLayout(displayName = "Daydream Headset", hideInUI = true)] + public class DaydreamHMD : XRHMD + { + } + + /// + /// An XR controller powered by Google Daydream. + /// + [InputControlLayout(displayName = "Daydream Controller", commonUsages = new[] { "LeftHand", "RightHand" }, hideInUI = true)] + public class DaydreamController : XRController + { + [InputControl] + public Vector2Control touchpad { get; protected set; } + [InputControl] + public ButtonControl volumeUp { get; protected set; } + [InputControl] + public ButtonControl recentered { get; protected set; } + [InputControl] + public ButtonControl volumeDown { get; protected set; } + [InputControl] + public ButtonControl recentering { get; protected set; } + [InputControl] + public ButtonControl app { get; protected set; } + [InputControl] + public ButtonControl home { get; protected set; } + [InputControl] + public ButtonControl touchpadClicked { get; protected set; } + [InputControl] + public ButtonControl touchpadTouched { get; protected set; } + [InputControl(noisy = true)] + public Vector3Control deviceVelocity { get; protected set; } + [InputControl(noisy = true)] + public Vector3Control deviceAcceleration { get; protected set; } + + protected override void FinishSetup() + { + base.FinishSetup(); + + touchpad = GetChildControl("touchpad"); + volumeUp = GetChildControl("volumeUp"); + recentered = GetChildControl("recentered"); + volumeDown = GetChildControl("volumeDown"); + recentering = GetChildControl("recentering"); + app = GetChildControl("app"); + home = GetChildControl("home"); + touchpadClicked = GetChildControl("touchpadClicked"); + touchpadTouched = GetChildControl("touchpadTouched"); + deviceVelocity = GetChildControl("deviceVelocity"); + deviceAcceleration = GetChildControl("deviceAcceleration"); + } + } +} +#endif diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta new file mode 100644 index 0000000000..b65525d7c9 --- /dev/null +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44353112a58c73347adde914844b7642 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs index 4dfbd1374d..3b26aa6be9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/XR/XRSupport.cs @@ -450,6 +450,18 @@ public static void Initialize() .WithProduct("^(Oculus Tracked Remote)")); #endif + // Built-in layouts replaced by the com.unity.xr.googlevr package. +#if !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR + InputSystem.RegisterLayout( + matches: new InputDeviceMatcher() + .WithInterface(XRUtilities.InterfaceMatchAnyVersion) + .WithProduct("Daydream HMD")); + InputSystem.RegisterLayout( + matches: new InputDeviceMatcher() + .WithInterface(XRUtilities.InterfaceMatchAnyVersion) + .WithProduct("^(Daydream Controller)")); +#endif + // Built-in layouts replaced by the com.unity.xr.openvr package. #if !DISABLE_BUILTIN_INPUT_SYSTEM_OPENVR InputSystem.RegisterLayout( diff --git a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef index d2f38a6a50..253ad9c2f9 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef +++ b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef @@ -17,6 +17,11 @@ "expression": "1.0.3", "define": "DISABLE_BUILTIN_INPUT_SYSTEM_OCULUS" }, + { + "name": "com.unity.xr.googlevr", + "expression": "1.0.0", + "define": "DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR" + }, { "name": "com.unity.xr.openvr", "expression": "1.0.0",