Skip to content

Commit 92d5837

Browse files
authored
Merge pull request #9670 from keveleigh/add-enum-to-attributes
Add SupportedUnityXRPipelines enum to attributes
2 parents a7c8710 + 9dd462b commit 92d5837

38 files changed

+105
-43
lines changed

Assets/MRTK/Core/Attributes/MixedRealityControllerAttribute.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,26 @@ public class MixedRealityControllerAttribute : Attribute
3838
/// </summary>
3939
public MixedRealityControllerConfigurationFlags Flags { get; }
4040

41+
/// <summary>
42+
/// The supported Unity XR pipelines for this controller.
43+
/// </summary>
44+
public SupportedUnityXRPipelines SupportedUnityXRPipelines { get; }
45+
4146
/// <summary>
4247
///
4348
/// </summary>
4449
public MixedRealityControllerAttribute(
4550
SupportedControllerType supportedControllerType,
4651
Handedness[] supportedHandedness,
4752
string texturePath = "",
48-
MixedRealityControllerConfigurationFlags flags = 0)
53+
MixedRealityControllerConfigurationFlags flags = 0,
54+
SupportedUnityXRPipelines supportedUnityXRPipelines = (SupportedUnityXRPipelines)(-1))
4955
{
5056
SupportedControllerType = supportedControllerType;
5157
SupportedHandedness = supportedHandedness;
5258
TexturePath = texturePath;
5359
Flags = flags;
60+
SupportedUnityXRPipelines = supportedUnityXRPipelines;
5461
}
5562

5663
/// <summary>

Assets/MRTK/Core/Attributes/MixedRealityDataProviderAttribute.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,31 @@ namespace Microsoft.MixedReality.Toolkit
99
/// <summary>
1010
/// Attribute that defines the properties of a Mixed Reality Toolkit data provider.
1111
/// </summary>
12-
[AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false)]
12+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
1313
public class MixedRealityDataProviderAttribute : MixedRealityExtensionServiceAttribute
1414
{
1515
/// <summary>
1616
/// The interface type of the IMixedRealityService for which the data provider is supported.
1717
/// </summary>
1818
public Type ServiceInterfaceType { get; }
1919

20+
/// <summary>
21+
/// The supported Unity XR pipelines for this data provider.
22+
/// </summary>
23+
public SupportedUnityXRPipelines SupportedUnityXRPipelines { get; }
24+
2025
public MixedRealityDataProviderAttribute(
2126
Type serviceInterfaceType,
2227
SupportedPlatforms runtimePlatforms,
2328
string name = "",
2429
string profilePath = "",
2530
string packageFolder = "MixedRealityToolkit",
26-
bool requiresProfile = false) : base(runtimePlatforms, name, profilePath, packageFolder, requiresProfile)
31+
bool requiresProfile = false,
32+
SupportedUnityXRPipelines supportedUnityXRPipelines = (SupportedUnityXRPipelines)(-1))
33+
: base(runtimePlatforms, name, profilePath, packageFolder, requiresProfile)
2734
{
2835
ServiceInterfaceType = serviceInterfaceType;
36+
SupportedUnityXRPipelines = supportedUnityXRPipelines;
2937
}
3038
}
3139
}

Assets/MRTK/Core/Definitions/Utilities/SupportedPlatforms.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Microsoft.MixedReality.Toolkit.Utilities
77
{
88
/// <summary>
9-
/// The supported platforms for Mixed Reality Toolkit Components and Features.
9+
/// The supported platforms for Mixed Reality Toolkit components and features.
1010
/// </summary>
1111
[Flags]
1212
public enum SupportedPlatforms
@@ -23,4 +23,14 @@ public enum SupportedPlatforms
2323
Web = 1 << 9,
2424
Lumin = 1 << 10
2525
}
26+
27+
/// <summary>
28+
/// The supported Unity XR pipelines for Mixed Reality Toolkit components and features.
29+
/// </summary>
30+
[Flags]
31+
public enum SupportedUnityXRPipelines
32+
{
33+
LegacyXR = 1 << 0,
34+
XRSDK = 1 << 1,
35+
}
2636
}

Assets/MRTK/Core/Providers/UnityInput/UnityJoystickManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ namespace Microsoft.MixedReality.Toolkit.Input.UnityInput
1717
[MixedRealityDataProvider(
1818
typeof(IMixedRealityInputSystem),
1919
(SupportedPlatforms)(-1), // All platforms supported by Unity
20-
"Unity Joystick Manager")]
20+
"Unity Joystick Manager",
21+
supportedUnityXRPipelines: SupportedUnityXRPipelines.LegacyXR)]
2122
public class UnityJoystickManager : BaseInputDeviceManager
2223
{
2324
/// <summary>

Assets/MRTK/Providers/Oculus/XRSDK/Controllers/OculusXRSDKTouchController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespace Microsoft.MixedReality.Toolkit.XRSDK.Oculus.Input
1818
[MixedRealityController(
1919
SupportedControllerType.OculusTouch,
2020
new[] { Handedness.Left, Handedness.Right },
21-
"Textures/OculusControllersTouch")]
21+
"Textures/OculusControllersTouch",
22+
supportedUnityXRPipelines: SupportedUnityXRPipelines.XRSDK)]
2223
public class OculusXRSDKTouchController : GenericXRSDKController
2324
{
2425
/// <summary>

Assets/MRTK/Providers/Oculus/XRSDK/MRTK-Quest/Scripts/Input/Controllers/OculusHand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ namespace Microsoft.MixedReality.Toolkit.XRSDK.Oculus.Input
4444
/// </summary>
4545
[MixedRealityController(
4646
SupportedControllerType.ArticulatedHand,
47-
new[] { Handedness.Left, Handedness.Right })]
47+
new[] { Handedness.Left, Handedness.Right },
48+
supportedUnityXRPipelines: SupportedUnityXRPipelines.XRSDK)]
4849
public class OculusHand : BaseHand
4950
{
5051
private MixedRealityPose currentPointerPose = MixedRealityPose.ZeroIdentity;

Assets/MRTK/Providers/Oculus/XRSDK/OculusXRSDKDeviceManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ namespace Microsoft.MixedReality.Toolkit.XRSDK.Oculus.Input
2727
"XR SDK Oculus Device Manager",
2828
"Oculus/XRSDK/Profiles/DefaultOculusXRSDKDeviceManagerProfile.asset",
2929
"MixedRealityToolkit.Providers",
30-
requiresProfile: true)]
30+
true,
31+
SupportedUnityXRPipelines.XRSDK)]
3132
public class OculusXRSDKDeviceManager : XRSDKDeviceManager
3233
{
3334
/// <summary>

Assets/MRTK/Providers/OpenVR/GenericOpenVRController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace Microsoft.MixedReality.Toolkit.OpenVR.Input
1515
[MixedRealityController(
1616
SupportedControllerType.GenericOpenVR,
1717
new[] { Handedness.Left, Handedness.Right },
18-
flags: MixedRealityControllerConfigurationFlags.UseCustomInteractionMappings)]
18+
flags: MixedRealityControllerConfigurationFlags.UseCustomInteractionMappings,
19+
supportedUnityXRPipelines: SupportedUnityXRPipelines.LegacyXR)]
1920
public class GenericOpenVRController : GenericJoystickController
2021
{
2122
public GenericOpenVRController(

Assets/MRTK/Providers/OpenVR/HPMotionController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace Microsoft.MixedReality.Toolkit.OpenVR.Input
1212
/// </summary>
1313
[MixedRealityController(
1414
SupportedControllerType.HPMotionController,
15-
new[] { Handedness.Left, Handedness.Right })]
15+
new[] { Handedness.Left, Handedness.Right },
16+
supportedUnityXRPipelines: SupportedUnityXRPipelines.LegacyXR)]
1617
public class HPMotionController : GenericOpenVRController
1718
{
1819
/// <summary>

Assets/MRTK/Providers/OpenVR/OculusRemoteController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace Microsoft.MixedReality.Toolkit.OpenVR.Input
1010
[MixedRealityController(
1111
SupportedControllerType.OculusRemote,
1212
new[] { Handedness.None },
13-
"Textures/OculusRemoteController")]
13+
"Textures/OculusRemoteController",
14+
supportedUnityXRPipelines: SupportedUnityXRPipelines.LegacyXR)]
1415
public class OculusRemoteController : GenericOpenVRController
1516
{
1617
/// <summary>

0 commit comments

Comments
 (0)