Skip to content

Commit 61585c7

Browse files
authored
Clarify newly obsolete code due to XRI3 refactor (#1047)
* Remove obsolete field * Clarify the version origin of newly deprecated items, as well as removing some stale obsolete code Signed-off-by: Kurtis <[email protected]> * Update InteractionModeManager.cs --------- Signed-off-by: Kurtis <[email protected]>
1 parent aeecff3 commit 61585c7

File tree

18 files changed

+31
-108
lines changed

18 files changed

+31
-108
lines changed

org.mixedrealitytoolkit.core/Interactors/IModeManagedInteractor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IModeManagedInteractor
1616
/// Returns the GameObject that this interactor belongs to. This GameObject is governed by the
1717
/// interaction mode manager and is assigned an interaction mode. This GameObject represents the 'controller' that this interactor belongs to.
1818
/// </summary>
19-
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
19+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
2020
public GameObject GetModeManagedController();
2121

2222
/// <summary>

org.mixedrealitytoolkit.core/Utilities/ControllerLookup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace MixedReality.Toolkit
1313
/// </summary>
1414
[DisallowMultipleComponent]
1515
[AddComponentMenu("MRTK/Core/Controller Lookup")]
16-
[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
16+
[Obsolete("ControllerLookup has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
1717
public class ControllerLookup : MonoBehaviour
1818
{
1919
// Gaze

org.mixedrealitytoolkit.input/Controllers/ActionBasedControllerWithFallbacks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace MixedReality.Toolkit.Input
1919
/// state will have no position and no rotation data. In this case, the controller may want to fallback to head pose.
2020
/// </remarks>
2121
[AddComponentMenu("MRTK/Input/XR Controller (Action-based with Fallbacks)")]
22-
[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverWithFallback")]
22+
[Obsolete("ActionBasedControllerWithFallbacks has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverWithFallback")]
2323
public class ActionBasedControllerWithFallbacks : ActionBasedController
2424
{
2525
#region Fallback actions values

org.mixedrealitytoolkit.input/InteractionModes/FlatScreenModeDetector.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
using System;
55
using System.Collections.Generic;
66
using UnityEngine;
7-
using UnityEngine.InputSystem.XR;
87
using UnityEngine.Serialization;
9-
using UnityEngine.XR;
108

119
namespace MixedReality.Toolkit.Input
1210
{
@@ -23,7 +21,7 @@ internal class FlatScreenModeDetector : MonoBehaviour, IInteractionModeDetector
2321

2422
public InteractionMode ModeOnDetection => flatScreenInteractionMode;
2523

26-
[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
24+
[Obsolete("This field has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
2725
protected ControllerLookup controllerLookup = null;
2826

2927
protected TrackedPoseDriverLookup trackedPoseDriverLookup = null;
@@ -40,22 +38,22 @@ protected void Awake()
4038
trackedPoseDriverLookup = ComponentCache<TrackedPoseDriverLookup>.FindFirstActiveInstance();
4139
}
4240

43-
/// <inheritdoc />
44-
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
41+
/// <inheritdoc />
42+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
4543
public List<GameObject> GetControllers() => GetInteractorGroups();
4644

47-
/// <inheritdoc />
45+
/// <inheritdoc />
4846
public List<GameObject> GetInteractorGroups() => interactorGroups;
4947

5048
public bool IsModeDetected()
5149
{
5250
// Flat screen mode is only active if the Left and Right Hands aren't being tracked
53-
#pragma warning disable CS0618 // Type or member is obsolete
51+
#pragma warning disable CS0618 // Type or member is obsolete
5452
if (controllerLookup != null)
5553
{
5654
return !controllerLookup.LeftHandController.currentControllerState.inputTrackingState.HasPositionAndRotation() && !controllerLookup.RightHandController.currentControllerState.inputTrackingState.HasPositionAndRotation();
5755
}
58-
#pragma warning restore CS0618
56+
#pragma warning restore CS0618
5957
else if (trackedPoseDriverLookup != null)
6058
{
6159
return !trackedPoseDriverLookup.LeftHandTrackedPoseDriver.GetInputTrackingState().HasPositionAndRotation() &&

org.mixedrealitytoolkit.input/InteractionModes/IInteractionModeDetector.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System;
55
using System.Collections.Generic;
66
using UnityEngine;
7-
using UnityEngine.XR.Interaction.Toolkit;
8-
97

108
namespace MixedReality.Toolkit.Input
119
{
@@ -32,7 +30,7 @@ public interface IInteractionModeDetector
3230
/// Get a list of the <see cref="GameObject"/> instances which represent the controllers that this interaction mode detector has jurisdiction over.
3331
/// </summary>
3432
/// <returns>The list of the <see cref="GameObject"/> instances which represent the controllers that this interaction mode detector has jurisdiction over.</returns>
35-
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
33+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
3634
List<GameObject> GetControllers();
3735

3836
/// <summary>

org.mixedrealitytoolkit.input/InteractionModes/InteractionDetector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ private InteractionMode GetDetectedMode()
110110
[Tooltip("List of GameObjects which represent the interactor groups that this interaction mode detector has jurisdiction over. Interaction modes will be set on all specified groups.")]
111111
private List<GameObject> interactorGroups;
112112

113-
/// <inheritdoc />
114-
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
113+
/// <inheritdoc />
114+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
115115
public List<GameObject> GetControllers() => GetInteractorGroups();
116116

117-
/// <inheritdoc />
117+
/// <inheritdoc />
118118
public List<GameObject> GetInteractorGroups() => interactorGroups;
119119

120120
/// <inheritdoc />

org.mixedrealitytoolkit.input/InteractionModes/InteractionModeManager.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
using UnityEngine.XR.Interaction.Toolkit;
1212
using UnityEngine.XR.Interaction.Toolkit.Interactors;
1313

14-
using TrackedPoseDriver = UnityEngine.InputSystem.XR.TrackedPoseDriver;
15-
1614
namespace MixedReality.Toolkit.Input
1715
{
1816
/// <summary>
@@ -72,7 +70,7 @@ public static InteractionModeManager Instance
7270
/// <summary>
7371
/// Editor only function for initializing the Interaction Mode Manager with the existing XR controllers in the scene
7472
/// </summary>
75-
[Obsolete("This method is obsolete. Please use InitializeInteractorGroups instead.")]
73+
[Obsolete("This method has been deprecated in version 4.0.0. Please use InitializeInteractorGroups instead.")]
7674
public void InitializeControllers()
7775
{
7876
foreach (XRBaseController xrController in FindObjectUtility.FindObjectsByType<XRBaseController>())
@@ -436,13 +434,10 @@ private void Update()
436434
{
437435
List<GameObject> groups = detector.GetInteractorGroups();
438436

439-
// For backwards compatibility, we will continue to support the obsolete "GetControllers()" function.
440-
if (groups == null)
441-
{
442437
#pragma warning disable CS0618 // GetControllers is obsolete
443-
groups = detector.GetControllers();
438+
// For backwards compatibility, we will continue to support the obsolete "GetControllers()" function.
439+
groups ??= detector.GetControllers();
444440
#pragma warning restore CS0618 // GetControllers is obsolete
445-
}
446441

447442
foreach (GameObject group in groups)
448443
{

org.mixedrealitytoolkit.input/InteractionModes/ProximityDetector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ProximityDetector : MonoBehaviour, IInteractionModeDetector
4141
private List<GameObject> interactorGroups;
4242

4343
/// <inheritdoc />
44-
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
44+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
4545
public List<GameObject> GetControllers() => GetInteractorGroups();
4646

4747
/// <inheritdoc />

org.mixedrealitytoolkit.input/Interactors/Gaze/GazeInteractor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public GameObject ModeManagedRoot
3434
}
3535

3636
/// <inheritdoc/>
37-
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
37+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
3838
public GameObject GetModeManagedController()
3939
{
4040
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the

org.mixedrealitytoolkit.input/Interactors/GazePinch/GazePinchInteractor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public GameObject ModeManagedRoot
5757

5858
[SerializeField]
5959
[Tooltip("The hand controller used to get the selection progress values")]
60-
[Obsolete("Deprecated, please use this.TrackedPoseDriver instead.")]
60+
[Obsolete("This field has been deprecated in version 4.0.0. Please use this.TrackedPoseDriver instead.")]
6161
private ArticulatedHandController handController;
6262

6363
/// <summary>
@@ -558,7 +558,7 @@ protected override void OnSelectExited(SelectExitEventArgs args)
558558
#region IModeManagedInteractor
559559

560560
/// <inheritdoc/>
561-
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
561+
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
562562
public GameObject GetModeManagedController()
563563
{
564564
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the

0 commit comments

Comments
 (0)