Skip to content

Commit aba727f

Browse files
author
Rene Damm
authored
FIX: Display names in UI being wrong for XR controllers and HMDs (#1021, #1035).
1 parent c9b831e commit aba727f

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

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

1212
### Fixed
1313

14+
- XR controllers and HMDs have proper display names in the UI again. This regressed in preview.4 such that all XR controllers were displayed as just "XR Controller" in the UI and all HMDs were displayed as "XR HMD".
15+
1416
#### Actions
1517

1618
- Removing a callback from actions from the callback itself no longer throws `ArgumentOutOfRangeException` ([case 1192972](https://issuetracker.unity3d.com/issues/input-system-package-argumentoutofrangeexception-error-is-thrown-when-the-callback-is-removed-while-its-being-triggered)).

Packages/com.unity.inputsystem/InputSystem/Actions/InputActionRebindingExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// - By group (e.g. "search for binding on action 'fire' with group 'keyboard&mouse' and override it with '<Keyboard>/space'")
1212
// - By action (e.g. "bind action 'fire' from whatever it is right now to '<Gamepad>/leftStick'")
1313

14+
////TODO: make this work implicitly with PlayerInputs such that rebinds can be restricted to the device's of a specific player
15+
1416
////TODO: allow rebinding by GUIDs now that we have IDs on bindings
1517

1618
////FIXME: properly work with composites

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Unity.XR.GoogleVr
99
/// <summary>
1010
/// A head-mounted display powered by Google Daydream.
1111
/// </summary>
12-
[InputControlLayout]
12+
[InputControlLayout(displayName = "Daydream Headset")]
1313
[Preserve]
1414
public class DaydreamHMD : XRHMD
1515
{
@@ -18,7 +18,7 @@ public class DaydreamHMD : XRHMD
1818
/// <summary>
1919
/// An XR controller powered by Google Daydream.
2020
/// </summary>
21-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
21+
[InputControlLayout(displayName = "Daydream Controller", commonUsages = new[] { "LeftHand", "RightHand" })]
2222
[Preserve]
2323
public class DaydreamController : XRController
2424
{

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Unity.XR.Oculus.Input
1010
/// <summary>
1111
/// An Oculus VR headset (such as the Oculus Rift series of devices).
1212
/// </summary>
13+
[InputControlLayout(displayName = "Oculus Headset")]
1314
[Preserve]
1415
public class OculusHMD : XRHMD
1516
{
@@ -80,7 +81,7 @@ protected override void FinishSetup()
8081
/// An Oculus Touch controller.
8182
/// </summary>
8283
[Preserve]
83-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
84+
[InputControlLayout(displayName = "Oculus Touch Controller", commonUsages = new[] { "LeftHand", "RightHand" })]
8485
public class OculusTouchController : XRControllerWithRumble
8586
{
8687
[Preserve]
@@ -189,6 +190,7 @@ protected override void FinishSetup()
189190
/// <summary>
190191
/// An Oculus Remote controller.
191192
/// </summary>
193+
[InputControlLayout(displayName = "Oculus Remote")]
192194
[Preserve]
193195
public class OculusRemote : InputDevice
194196
{
@@ -215,6 +217,7 @@ protected override void FinishSetup()
215217
/// <summary>
216218
/// A Standalone VR headset that includes on-headset controls.
217219
/// </summary>
220+
[InputControlLayout(displayName = "Oculus Headset (w/ on-headset controls)")]
218221
[Preserve]
219222
public class OculusHMDExtended : OculusHMD
220223
{
@@ -238,7 +241,7 @@ protected override void FinishSetup()
238241
/// A Gear VR controller.
239242
/// </summary>
240243
[Preserve]
241-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
244+
[InputControlLayout(displayName = "GearVR Controller", commonUsages = new[] { "LeftHand", "RightHand" })]
242245
public class GearVRTrackedController : XRController
243246
{
244247
[Preserve]

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Unity.XR.OpenVR
99
{
10-
[InputControlLayout]
10+
[InputControlLayout(displayName = "OpenVR Headset")]
1111
[Preserve]
1212
public class OpenVRHMD : XRHMD
1313
{
@@ -51,7 +51,7 @@ protected override void FinishSetup()
5151
}
5252
}
5353

54-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
54+
[InputControlLayout(displayName = "Windows MR Controller (OpenVR)", commonUsages = new[] { "LeftHand", "RightHand" })]
5555
[Preserve]
5656
public class OpenVRControllerWMR : XRController
5757
{
@@ -115,7 +115,7 @@ protected override void FinishSetup()
115115
/// <summary>
116116
/// An HTC Vive Wand controller.
117117
/// </summary>
118-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
118+
[InputControlLayout(displayName = "Vive Wand", commonUsages = new[] { "LeftHand", "RightHand" })]
119119
[Preserve]
120120
public class ViveWand : XRControllerWithRumble
121121
{
@@ -172,7 +172,7 @@ protected override void FinishSetup()
172172
/// <summary>
173173
/// An HTC Vive lighthouse.
174174
/// </summary>
175-
[InputControlLayout]
175+
[InputControlLayout(displayName = "Vive Lighthouse")]
176176
[Preserve]
177177
public class ViveLighthouse : TrackedDevice
178178
{
@@ -181,6 +181,7 @@ public class ViveLighthouse : TrackedDevice
181181
/// <summary>
182182
/// An HTC Vive tracker.
183183
/// </summary>
184+
[InputControlLayout(displayName = "Vive Tracker")]
184185
[Preserve]
185186
public class ViveTracker : TrackedDevice
186187
{
@@ -200,7 +201,7 @@ protected override void FinishSetup()
200201
}
201202
}
202203

203-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
204+
[InputControlLayout(displayName = "Handed Vive Tracker", commonUsages = new[] { "LeftHand", "RightHand" })]
204205
[Preserve]
205206
public class HandedViveTracker : ViveTracker
206207
{
@@ -235,7 +236,7 @@ protected override void FinishSetup()
235236
/// <summary>
236237
/// An Oculus Touch controller.
237238
/// </summary>
238-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
239+
[InputControlLayout(displayName = "Oculus Touch Controller (OpenVR)", commonUsages = new[] { "LeftHand", "RightHand" })]
239240
[Preserve]
240241
public class OpenVROculusTouchController : XRControllerWithRumble
241242
{

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace UnityEngine.XR.WindowsMR.Input
1010
/// A Windows Mixed Reality XR headset.
1111
/// </summary>
1212
[Preserve]
13+
[InputControlLayout(displayName = "Windows MR Headset")]
1314
public class WMRHMD : XRHMD
1415
{
1516
[Preserve]
@@ -30,7 +31,7 @@ protected override void FinishSetup()
3031
/// A Windows Mixed Reality XR controller.
3132
/// </summary>
3233
[Preserve]
33-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
34+
[InputControlLayout(displayName = "HoloLens Hand", commonUsages = new[] { "LeftHand", "RightHand" })]
3435
public class HololensHand : XRController
3536
{
3637
[Preserve]
@@ -58,7 +59,7 @@ protected override void FinishSetup()
5859
}
5960

6061
[Preserve]
61-
[InputControlLayout(commonUsages = new[] { "LeftHand", "RightHand" })]
62+
[InputControlLayout(displayName = "Windows MR Controller", commonUsages = new[] { "LeftHand", "RightHand" })]
6263
public class WMRSpatialController : XRControllerWithRumble
6364
{
6465
[Preserve]

0 commit comments

Comments
 (0)