Skip to content

Commit 407eef5

Browse files
authored
Merge branch 'develop' into isxb-897-manually-allocate-splitscreenindex
2 parents 21c5347 + e6254ab commit 407eef5

File tree

8 files changed

+74
-26
lines changed

8 files changed

+74
-26
lines changed

Assets/Tests/InputSystem/Plugins/XInputTests.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEngine.InputSystem.Layouts;
66
using UnityEngine.InputSystem.Utilities;
77
using System.Runtime.InteropServices;
8+
using UnityEngine.InputSystem.Controls;
89
using UnityEngine.InputSystem.HID;
910
using UnityEngine.InputSystem.Processors;
1011

@@ -207,8 +208,6 @@ public void Devices_SupportWirelessXboxOneAndSeriesControllerOnOSX(int vendorId,
207208
Assert.That(gamepad.startButton.isPressed);
208209
}
209210

210-
// Disable tests in standalone builds from 2022.1+ see UUM-19622
211-
#if !UNITY_STANDALONE_OSX || !TEMP_DISABLE_STANDALONE_OSX_XINPUT_TEST
212211
[Test]
213212
[Category("Devices")]
214213
public void Devices_SupportXboxWirelessControllerOnOSX()
@@ -242,6 +241,8 @@ public void Devices_SupportXboxWirelessControllerOnOSX()
242241

243242
InputSystem.Update();
244243

244+
Assert.That(gamepad.leftStick.x.IsActuated());
245+
245246
Assert.That(gamepad.leftStick.x.ReadValue(), Is.EqualTo(0.9999).Within(0.001));
246247
Assert.That(gamepad.leftStick.y.ReadValue(), Is.EqualTo(0.9999).Within(0.001));
247248
Assert.That(gamepad.leftStick.up.ReadValue(), Is.EqualTo(0.9999).Within(0.001));
@@ -268,10 +269,17 @@ public void Devices_SupportXboxWirelessControllerOnOSX()
268269
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithButton(XInputControllerWirelessOSXState.Button.Y), gamepad.yButton);
269270
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithButton(XInputControllerWirelessOSXState.Button.Y), gamepad.buttonNorth);
270271

271-
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(5), gamepad.dpad.down);
272272
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(1), gamepad.dpad.up);
273-
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(7), gamepad.dpad.left);
273+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(2), gamepad.dpad.up, gamepad.dpad.right);
274274
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(3), gamepad.dpad.right);
275+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(4), gamepad.dpad.down, gamepad.dpad.right);
276+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(5), gamepad.dpad.down);
277+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(6), gamepad.dpad.down, gamepad.dpad.left);
278+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(7), gamepad.dpad.left);
279+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(8), gamepad.dpad.up, gamepad.dpad.left);
280+
// No Dpad button pressed when the value is 0
281+
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithDpad(0));
282+
275283

276284
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithButton(XInputControllerWirelessOSXState.Button.LeftThumbstickPress), gamepad.leftStickButton);
277285
AssertButtonPress(gamepad, XInputControllerWirelessOSXState.defaultState.WithButton(XInputControllerWirelessOSXState.Button.RightThumbstickPress), gamepad.rightStickButton);
@@ -306,9 +314,6 @@ public void Devices_SupportXboxWirelessControllerOnOSX()
306314

307315
#endif // TEMP_DISABLE_STANDALONE_OSX_XINPUT_TEST
308316

309-
#endif
310-
311-
312317
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA
313318
[Test]
314319
[Category("Devices")]

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ however, it has to be formatted properly to pass verification tests.
1010

1111
## [Unreleased] - yyyy-mm-dd
1212

13+
### Fixed
14+
- Fixed an analytics event being invoked twice when the Save button in the Actions view was pressed. [ISXB-1378](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1378)
1315
- Fixed an issue causing a number of errors to be displayed when using `InputTestFixture` in playmode tests with domain reloading disabled on playmode entry. [ISXB-1446](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1446)
1416
- Fixed issue where user was not prompted to save changes when loading a second input actions asset into an already opened editor. [ISXB-1343](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1343)
17+
- Fixed an issue on macOS which didn't detect up-left DPAD presses for Xbox controllers. [ISXB-810](https://issuetracker.unity3d.com/issues/macos-d-pad-upper-left-corner-is-not-logged-with-the-xbox-controller)
1518
- Fixed an issue when providing JoinPlayer with a specific split screen index. [ISXB-897](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-897)
1619

1720
## [1.14.0] - 2025-03-20
@@ -27,6 +30,7 @@ however, it has to be formatted properly to pass verification tests.
2730

2831
### Added
2932
- Added support of F13-F24 keys. [UUM-44328](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-44328)
33+
- Added missing documentation for the Tracked Pose Driver and Tracked Device Raycaster components. [ISXB-1410](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1410)
3034

3135
## [1.13.1] - 2025-02-18
3236

Packages/com.unity.inputsystem/Documentation~/TableOfContents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* [Player Input Component](PlayerInput.md)
2222
* [Player Input Manager Component](PlayerInputManager.md)
2323
* [Input settings](Settings.md)
24+
* [Tracked Input Devices](TrackedInputDevices.md)
2425
* [Advanced Topics]()
2526
* [Events](Events.md)
2627
* [Layouts](Layouts.md)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
uid: input-system-tracked-input-devices
3+
---
4+
# Tracked Input Devices
5+
6+
Some input devices can provide information about their spatial position and orientation. It can then be used to pose other objects in your scene, or to interact with your scene.
7+
8+
## Tracked Pose Driver
9+
10+
Use the Tracked Pose Driver component to synchronize a __GameObject__'s transform with input data from a tracked device such as an XR headset, motion controller, or other devices that provide positional and rotational tracking. It allows creating immersive XR experiences by dynamically updating the __GameObject__’s position and rotation based on the real-world movement of the tracked device. The component works with Unity's Input System to gather position, rotation, and tracking state data, and it provides several customization options, such as updating specific transform properties, controlling update timing, and managing how invalid tracking data is handled.
11+
12+
| **Property** | **Description** |
13+
|-------------|-----------|
14+
|[`Tracking Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingType)|Specify which transform properties (position, rotation, or both) to update based on the tracked data.|
15+
|[`Update Type`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_updateType)|Determine when updates to the transform occur within Unity's event loop, such as during rendering or gameplay.|
16+
|[`Ignore Tracking State`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_ignoreTrackingState)| Enable to ignore the tracking state and assume that the input pose is valid, even when flagged otherwise.|
17+
|[`Position Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_positionInput)|Set an input action that retrieves the position data (Vector3) of the tracked device.|
18+
|[`Rotation Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_rotationInput)| Set an input action that retrieves the rotation data (Quaternion) of the tracked device.|
19+
|[`Tracking State Input`](../api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html#UnityEngine_InputSystem_XR_TrackedPoseDriver_trackingStateInput)|Set an input action that determines whether the tracking state (position or rotation) is valid (integer).|
20+
21+
## Tracked Device Raycaster
22+
23+
Use the Tracked Device Raycaster component to enable ray casting from tracked input devices, such as XR controllers, to interact with UI elements rendered in 3D space.
24+
25+
Tracked Device Raycaster works with the the __Canvas__ component, and replaces the standard __GraphicRaycaster__ for XR and AR use cases. Use Tracked Device Raycaster to process pointer events that are based on ray intersections with graphics in world space.
26+
27+
The component also supports occlusion checks, custom ray distance limits, and filtering of reversed graphics to enable UI interactions in immersive environments. You can use it to build XR-enabled user interfaces where traditional 2D input methods, such as a mouse, do not apply.
28+
29+
| **Property** | **Description** |
30+
|-------------|-----------|
31+
|[`Ignore Reversed Graphics`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_ignoreReversedGraphics)| Enable to ignore graphics whose normal faces away from the direction of the ray.|
32+
|[`Check For 2D Occlusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor2DOcclusion)|Enable occlusion checks for 2D objects, such as sprites in the scene.|
33+
|[`Check For 3D Occulusion`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_checkFor3DOcclusion)|Enable occlusion checks for 3D objects to prevent rays from passing through physical geometry.|
34+
|[`Max Distance`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_maxDistance)|Set the maximum ray distance for interaction detection in world space coordinates.|
35+
|[`Blocking Mask`](../api/UnityEngine.InputSystem.UI.TrackedDeviceRaycaster.html#UnityEngine_InputSystem_UI_TrackedDeviceRaycaster_blockingMask)|Define the layer mask used to check for occlusion when ray casting.|

Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Commands/Commands.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,6 @@ public static Command SaveAsset(Action postSaveAction)
596596
// TODO It makes more sense to call back to editor since editor owns target object?
597597
//InputActionAssetManager.SaveAsset(state.serializedObject.targetObject as InputActionAsset);
598598
postSaveAction?.Invoke();
599-
state.m_Analytics?.RegisterExplicitSave();
600599
return state;
601600
};
602601
}

Packages/com.unity.inputsystem/InputSystem/Plugins/UI/TrackedDeviceRaycaster.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace UnityEngine.InputSystem.UI
1818
/// </remarks>
1919
[AddComponentMenu("Event/Tracked Device Raycaster")]
2020
[RequireComponent(typeof(Canvas))]
21+
[HelpURL(InputSystem.kDocUrl + "/manual/TrackedInputDevices.html#tracked-device-raycaster")]
2122
public class TrackedDeviceRaycaster : BaseRaycaster
2223
{
2324
private struct RaycastHitData

0 commit comments

Comments
 (0)