Skip to content

Commit 76f291a

Browse files
author
David Kline (ANALOG)
committed
wrap editor specific in ifdef
1 parent edf19fe commit 76f291a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Assets/MixedRealityToolkit/Definitions/Devices/MixedRealityControllerMappingProfile.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ namespace Microsoft.MixedReality.Toolkit.Core.Definitions.Devices
1919
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Controller Mapping Profile", fileName = "MixedRealityControllerMappingProfile", order = (int)CreateProfileMenuItemIndices.ControllerMapping)]
2020
public class MixedRealityControllerMappingProfile : BaseMixedRealityProfile
2121
{
22-
private static Type[] controllerMappingTypes;
23-
24-
public static Type[] ControllerMappingTypes { get { CollectControllerTypes(); return controllerMappingTypes; } }
25-
26-
public static Type[] CustomControllerMappingTypes { get => (from type in ControllerMappingTypes where UsesCustomInteractionMapping(type) select type).ToArray(); }
27-
2822
[SerializeField]
2923
[Tooltip("The list of controller templates your application can use.")]
3024
private MixedRealityControllerMapping[] mixedRealityControllerMappingProfiles = new MixedRealityControllerMapping[0];
3125

3226
public MixedRealityControllerMapping[] MixedRealityControllerMappingProfiles => mixedRealityControllerMappingProfiles;
3327

28+
#if UNITY_EDITOR
29+
30+
private static Type[] controllerMappingTypes;
31+
32+
public static Type[] ControllerMappingTypes { get { CollectControllerTypes(); return controllerMappingTypes; } }
33+
34+
public static Type[] CustomControllerMappingTypes { get => (from type in ControllerMappingTypes where UsesCustomInteractionMapping(type) select type).ToArray(); }
35+
3436
private static void CollectControllerTypes()
3537
{
3638
if (controllerMappingTypes == null)
@@ -121,6 +123,8 @@ private void SortMappings()
121123
});
122124
}
123125

126+
#endif // UNITY_EDITOR
127+
124128
private static bool UsesCustomInteractionMapping(Type controllerType)
125129
{
126130
var attribute = MixedRealityControllerAttribute.Find(controllerType);

0 commit comments

Comments
 (0)