From 570be7a66520ff27f24291100687699a5e6a0f65 Mon Sep 17 00:00:00 2001 From: "REDMOND\\shaynie" Date: Thu, 22 Jun 2023 13:11:57 -0700 Subject: [PATCH 1/2] Move input subsystem implementations to the input package. --- .../Packages/packages-lock.json | 1 + .../Hands/IHandsAggregatorSubsystem.cs | 3 ++- .../Subsystems/Speech/IDictationSubsystem.cs | 3 ++- .../Speech/IKeywordRecognitionSubsystem.cs | 3 ++- .../Utilities/HandsUtils.cs | 2 +- .../Utilities/XRSubsystemHelpers.cs | 18 +++++++++--------- .../Controllers/ArticulatedHandController.cs | 2 +- .../Interactors/Ray/MRTKRayInteractor.cs | 2 +- .../Hands/HandsAggregatorSubsystem.cs | 0 .../Hands/HandsAggregatorSubsystem.cs.meta | 0 .../Subsystems/Hands/HandsSubsystem.cs | 0 .../Subsystems/Hands/HandsSubsystem.cs.meta | 0 .../Hands/HandsSubsystemDescriptor.cs | 0 .../Hands/HandsSubsystemDescriptor.cs.meta | 0 .../Subsystems/Speech.meta | 8 ++++++++ .../Subsystems/Speech/DictationSubsystem.cs | 0 .../Speech/DictationSubsystem.cs.meta | 0 .../Speech/DictationSubsystemDescriptor.cs | 0 .../DictationSubsystemDescriptor.cs.meta | 0 .../Speech/KeywordRecognitionSubsystem.cs | 0 .../Speech/KeywordRecognitionSubsystem.cs.meta | 0 .../KeywordRecognitionSubsystemDescriptor.cs | 0 ...ywordRecognitionSubsystemDescriptor.cs.meta | 0 .../PoseSource/HandBasedPoseSource.cs | 2 +- .../ControllerVisualizer.cs | 2 +- .../NonNativeKeyboard/NonNativeKeyboard.cs | 2 +- .../MRTK.Speech.Windows.asmdef | 1 + com.microsoft.mrtk.windowsspeech/package.json | 1 + 28 files changed, 32 insertions(+), 18 deletions(-) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsAggregatorSubsystem.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsAggregatorSubsystem.cs.meta (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsSubsystem.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsSubsystem.cs.meta (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsSubsystemDescriptor.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Hands/HandsSubsystemDescriptor.cs.meta (100%) create mode 100644 com.microsoft.mrtk.input/Subsystems/Speech.meta rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/DictationSubsystem.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/DictationSubsystem.cs.meta (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/DictationSubsystemDescriptor.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/DictationSubsystemDescriptor.cs.meta (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/KeywordRecognitionSubsystem.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/KeywordRecognitionSubsystem.cs.meta (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs (100%) rename {com.microsoft.mrtk.core => com.microsoft.mrtk.input}/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs.meta (100%) diff --git a/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json b/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json index c615b30c39e..d5df9bc7ecc 100644 --- a/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json +++ b/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json @@ -188,6 +188,7 @@ "source": "local", "dependencies": { "com.microsoft.mrtk.core": "3.0.0", + "com.microsoft.mrtk.input": "3.0.0", "com.microsoft.mrtk.tts.windows": "1.0.1" } }, diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/IHandsAggregatorSubsystem.cs b/com.microsoft.mrtk.core/Subsystems/Hands/IHandsAggregatorSubsystem.cs index d61d0e3c26b..335cca690d3 100644 --- a/com.microsoft.mrtk.core/Subsystems/Hands/IHandsAggregatorSubsystem.cs +++ b/com.microsoft.mrtk.core/Subsystems/Hands/IHandsAggregatorSubsystem.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using UnityEngine; using UnityEngine.XR; namespace Microsoft.MixedReality.Toolkit.Subsystems @@ -20,7 +21,7 @@ namespace Microsoft.MixedReality.Toolkit.Subsystems /// See for the MRTK implementation. /// /// - public interface IHandsAggregatorSubsystem + public interface IHandsAggregatorSubsystem : ISubsystem { /// /// The playspace-local pose of the near interaction point. diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/IDictationSubsystem.cs b/com.microsoft.mrtk.core/Subsystems/Speech/IDictationSubsystem.cs index 7cd8ad468dc..7d3a81faae9 100644 --- a/com.microsoft.mrtk.core/Subsystems/Speech/IDictationSubsystem.cs +++ b/com.microsoft.mrtk.core/Subsystems/Speech/IDictationSubsystem.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Subsystems { @@ -11,7 +12,7 @@ namespace Microsoft.MixedReality.Toolkit.Subsystems /// MUST implement this interface, preferably with a direct 1:1 mapping /// between the provider surface and the subsystem surface. /// - public interface IDictationSubsystem + public interface IDictationSubsystem : ISubsystem { /// /// Start dictation with default configurations. diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/IKeywordRecognitionSubsystem.cs b/com.microsoft.mrtk.core/Subsystems/Speech/IKeywordRecognitionSubsystem.cs index aa49edc6640..703d4fa460b 100644 --- a/com.microsoft.mrtk.core/Subsystems/Speech/IKeywordRecognitionSubsystem.cs +++ b/com.microsoft.mrtk.core/Subsystems/Speech/IKeywordRecognitionSubsystem.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System.Collections.Generic; +using UnityEngine; using UnityEngine.Events; namespace Microsoft.MixedReality.Toolkit.Subsystems @@ -12,7 +13,7 @@ namespace Microsoft.MixedReality.Toolkit.Subsystems /// MUST implement this interface, preferably with a direct 1:1 mapping /// between the provider surface and the subsystem surface. /// - public interface IKeywordRecognitionSubsystem + public interface IKeywordRecognitionSubsystem : ISubsystem { /// /// Add or update a keyword to recognize. diff --git a/com.microsoft.mrtk.core/Utilities/HandsUtils.cs b/com.microsoft.mrtk.core/Utilities/HandsUtils.cs index 356faed91f8..ca0853e62e0 100644 --- a/com.microsoft.mrtk.core/Utilities/HandsUtils.cs +++ b/com.microsoft.mrtk.core/Utilities/HandsUtils.cs @@ -20,7 +20,7 @@ public static class HandsUtils /// The first running instance, or null. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator")] - public static HandsAggregatorSubsystem GetSubsystem() => XRSubsystemHelpers.HandsAggregator; + public static IHandsAggregatorSubsystem GetSubsystem() => XRSubsystemHelpers.HandsAggregator; internal static readonly HandFinger[] HandFingers = Enum.GetValues(typeof(HandFinger)) as HandFinger[]; diff --git a/com.microsoft.mrtk.core/Utilities/XRSubsystemHelpers.cs b/com.microsoft.mrtk.core/Utilities/XRSubsystemHelpers.cs index c89b3fd4cda..5aed0bb22f1 100644 --- a/com.microsoft.mrtk.core/Utilities/XRSubsystemHelpers.cs +++ b/com.microsoft.mrtk.core/Utilities/XRSubsystemHelpers.cs @@ -152,52 +152,52 @@ public static XRDisplaySubsystem DisplaySubsystem } } - private static HandsAggregatorSubsystem handsAggregator = null; + private static IHandsAggregatorSubsystem handsAggregator = null; /// /// The currently loaded and running hands aggregator, if any. /// - public static HandsAggregatorSubsystem HandsAggregator + public static IHandsAggregatorSubsystem HandsAggregator { get { if (handsAggregator == null || !handsAggregator.running) { - handsAggregator = GetFirstRunningSubsystem(); + handsAggregator = GetFirstRunningSubsystem(); } return handsAggregator; } } - private static DictationSubsystem dictationSubsystem = null; + private static IDictationSubsystem dictationSubsystem = null; /// /// The currently loaded and running dictation subsystem, if any. /// - public static DictationSubsystem DictationSubsystem + public static IDictationSubsystem DictationSubsystem { get { if (dictationSubsystem == null || !dictationSubsystem.running) { - dictationSubsystem = GetFirstRunningSubsystem(); + dictationSubsystem = GetFirstRunningSubsystem(); } return dictationSubsystem; } } - private static KeywordRecognitionSubsystem keywordRecognitionSubsystem = null; + private static IKeywordRecognitionSubsystem keywordRecognitionSubsystem = null; /// /// The currently loaded and running keyword recognition subsystem, if any. /// - public static KeywordRecognitionSubsystem KeywordRecognitionSubsystem + public static IKeywordRecognitionSubsystem KeywordRecognitionSubsystem { get { if (keywordRecognitionSubsystem == null || !keywordRecognitionSubsystem.running) { - keywordRecognitionSubsystem = GetFirstRunningSubsystem(); + keywordRecognitionSubsystem = GetFirstRunningSubsystem(); } return keywordRecognitionSubsystem; } diff --git a/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs b/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs index 5a5db2dbe48..acff7eb437d 100644 --- a/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs +++ b/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs @@ -40,7 +40,7 @@ public class ArticulatedHandController : ActionBasedController #region Properties [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; #endregion Properties diff --git a/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs b/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs index d3128d8ef0f..7b9387bf3f6 100644 --- a/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs +++ b/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs @@ -51,7 +51,7 @@ public class MRTKRayInteractor : /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; /// /// How unselected the interactor must be to initiate a new hover or selection on a new target. diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsAggregatorSubsystem.cs b/com.microsoft.mrtk.input/Subsystems/Hands/HandsAggregatorSubsystem.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsAggregatorSubsystem.cs rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsAggregatorSubsystem.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsAggregatorSubsystem.cs.meta b/com.microsoft.mrtk.input/Subsystems/Hands/HandsAggregatorSubsystem.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsAggregatorSubsystem.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsAggregatorSubsystem.cs.meta diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystem.cs b/com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystem.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystem.cs rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystem.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystem.cs.meta b/com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystem.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystem.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystem.cs.meta diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs b/com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystemDescriptor.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystemDescriptor.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs.meta b/com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystemDescriptor.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Hands/HandsSubsystemDescriptor.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Hands/HandsSubsystemDescriptor.cs.meta diff --git a/com.microsoft.mrtk.input/Subsystems/Speech.meta b/com.microsoft.mrtk.input/Subsystems/Speech.meta new file mode 100644 index 00000000000..f95583a81d8 --- /dev/null +++ b/com.microsoft.mrtk.input/Subsystems/Speech.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 462feba81ca370449a0ada55a5e82c80 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystem.cs b/com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystem.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystem.cs rename to com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystem.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystem.cs.meta b/com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystem.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystem.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystem.cs.meta diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystemDescriptor.cs b/com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystemDescriptor.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystemDescriptor.cs rename to com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystemDescriptor.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystemDescriptor.cs.meta b/com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystemDescriptor.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/DictationSubsystemDescriptor.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Speech/DictationSubsystemDescriptor.cs.meta diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystem.cs b/com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystem.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystem.cs rename to com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystem.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystem.cs.meta b/com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystem.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystem.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystem.cs.meta diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs b/com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs rename to com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs diff --git a/com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs.meta b/com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs.meta similarity index 100% rename from com.microsoft.mrtk.core/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs.meta rename to com.microsoft.mrtk.input/Subsystems/Speech/KeywordRecognitionSubsystemDescriptor.cs.meta diff --git a/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs b/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs index f254611b837..9e2f09ea859 100644 --- a/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs +++ b/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs @@ -16,7 +16,7 @@ public abstract class HandBasedPoseSource : IPoseSource /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; [SerializeField] [Tooltip("The hand on which to track the joint.")] diff --git a/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs b/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs index 2ea064e58a7..be36f9ad1ae 100644 --- a/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs +++ b/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs @@ -48,7 +48,7 @@ public class ControllerVisualizer : MonoBehaviour /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; [SerializeField] [Tooltip("The input action we key into to determine whether this controller is tracked or not")] diff --git a/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeKeyboard.cs b/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeKeyboard.cs index 41b6c057a58..b4262ff8fa8 100644 --- a/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeKeyboard.cs +++ b/com.microsoft.mrtk.uxcore/Experimental/NonNativeKeyboard/NonNativeKeyboard.cs @@ -236,7 +236,7 @@ private set /// /// The keyword recognition subsystem that was stopped by this component. /// - private KeywordRecognitionSubsystem keywordRecognitionSubsystem = null; + private IKeywordRecognitionSubsystem keywordRecognitionSubsystem = null; /// /// The inner text value set via the `Text` property diff --git a/com.microsoft.mrtk.windowsspeech/MRTK.Speech.Windows.asmdef b/com.microsoft.mrtk.windowsspeech/MRTK.Speech.Windows.asmdef index bc309e96f6f..36b21dc22f9 100644 --- a/com.microsoft.mrtk.windowsspeech/MRTK.Speech.Windows.asmdef +++ b/com.microsoft.mrtk.windowsspeech/MRTK.Speech.Windows.asmdef @@ -3,6 +3,7 @@ "rootNamespace": "Microsoft.MixedReality.Toolkit.Speech.Windows", "references": [ "Microsoft.MixedReality.Toolkit.Core", + "Microsoft.MixedReality.Toolkit.Input", "Microsoft.MixedReality.OpenXR", "Microsoft.MixedReality.Toolkit.TextToSpeech.Windows" ], diff --git a/com.microsoft.mrtk.windowsspeech/package.json b/com.microsoft.mrtk.windowsspeech/package.json index 19c9d91c5c8..b49fd8e8f76 100644 --- a/com.microsoft.mrtk.windowsspeech/package.json +++ b/com.microsoft.mrtk.windowsspeech/package.json @@ -16,6 +16,7 @@ "unity": "2021.3", "dependencies": { "com.microsoft.mrtk.core": "3.0.0", + "com.microsoft.mrtk.input": "3.0.0", "com.microsoft.mrtk.tts.windows": "1.0.1" } } \ No newline at end of file From 872573b10d88451c9e33e0bb8e65088f64e88184 Mon Sep 17 00:00:00 2001 From: "REDMOND\\shaynie" Date: Thu, 22 Jun 2023 15:09:29 -0700 Subject: [PATCH 2/2] Address code review comments --- .../Controllers/ArticulatedHandController.cs | 2 +- com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs | 2 +- .../Utilities/PoseSource/HandBasedPoseSource.cs | 2 +- .../Visualizers/ControllerVisualizer/ControllerVisualizer.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs b/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs index acff7eb437d..62f5792d8c7 100644 --- a/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs +++ b/com.microsoft.mrtk.input/Controllers/ArticulatedHandController.cs @@ -40,7 +40,7 @@ public class ArticulatedHandController : ActionBasedController #region Properties [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator as HandsAggregatorSubsystem; #endregion Properties diff --git a/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs b/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs index 7b9387bf3f6..29ee92bd802 100644 --- a/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs +++ b/com.microsoft.mrtk.input/Interactors/Ray/MRTKRayInteractor.cs @@ -51,7 +51,7 @@ public class MRTKRayInteractor : /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator as HandsAggregatorSubsystem; /// /// How unselected the interactor must be to initiate a new hover or selection on a new target. diff --git a/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs b/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs index 9e2f09ea859..7b741887c12 100644 --- a/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs +++ b/com.microsoft.mrtk.input/Utilities/PoseSource/HandBasedPoseSource.cs @@ -16,7 +16,7 @@ public abstract class HandBasedPoseSource : IPoseSource /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator as HandsAggregatorSubsystem; [SerializeField] [Tooltip("The hand on which to track the joint.")] diff --git a/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs b/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs index be36f9ad1ae..a523f5f7061 100644 --- a/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs +++ b/com.microsoft.mrtk.input/Visualizers/ControllerVisualizer/ControllerVisualizer.cs @@ -48,7 +48,7 @@ public class ControllerVisualizer : MonoBehaviour /// Cached reference to hands aggregator for efficient per-frame use. /// [Obsolete("Deprecated, please use XRSubsystemHelpers.HandsAggregator instead.")] - protected HandsAggregatorSubsystem HandsAggregator => (HandsAggregatorSubsystem)XRSubsystemHelpers.HandsAggregator; + protected HandsAggregatorSubsystem HandsAggregator => XRSubsystemHelpers.HandsAggregator as HandsAggregatorSubsystem; [SerializeField] [Tooltip("The input action we key into to determine whether this controller is tracked or not")]