Skip to content

Commit 0bfbec7

Browse files
authored
Merge pull request #9985 from keveleigh/2.7.1-cherrypicks
2.7.1 cherrypicks round 2
2 parents d9ec21d + 520a5d5 commit 0bfbec7

File tree

8 files changed

+96
-11
lines changed

8 files changed

+96
-11
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
5+
using System;
6+
using UnityEditor;
7+
using UnityEngine;
8+
9+
namespace Microsoft.MixedReality.Toolkit.Editor
10+
{
11+
internal class MRTKVersionPopup : EditorWindow
12+
{
13+
private const string DefaultVersion = "0.0.0.0";
14+
private const string NotFoundMessage = "The version could not be read. This is most often due to (and expected when) using MRTK directly from the repo. If you're using an official distribution and seeing this message, please file a GitHub issue!";
15+
private static readonly Version MRTKVersion = typeof(MixedRealityToolkit).Assembly.GetName().Version;
16+
private static readonly bool FoundVersion = MRTKVersion.ToString() != DefaultVersion;
17+
private static readonly Vector2 WindowSize = new Vector2(300, 140);
18+
private static readonly Vector2 NotFoundWindowSize = new Vector2(300, 175);
19+
private static readonly GUIContent Title = new GUIContent("Mixed Reality Toolkit");
20+
private static MRTKVersionPopup window;
21+
22+
[MenuItem("Mixed Reality/Toolkit/Show version...", priority = int.MaxValue)]
23+
private static void Init()
24+
{
25+
if (window != null)
26+
{
27+
window.ShowUtility();
28+
return;
29+
}
30+
31+
window = CreateInstance<MRTKVersionPopup>();
32+
window.titleContent = Title;
33+
window.maxSize = FoundVersion ? WindowSize : NotFoundWindowSize;
34+
window.minSize = FoundVersion ? WindowSize : NotFoundWindowSize;
35+
window.ShowUtility();
36+
}
37+
38+
private void OnGUI()
39+
{
40+
using (new EditorGUILayout.VerticalScope())
41+
{
42+
MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();
43+
44+
using (new EditorGUILayout.HorizontalScope())
45+
{
46+
GUILayout.FlexibleSpace();
47+
EditorGUILayout.LabelField(FoundVersion ? $"Version {MRTKVersion}" : NotFoundMessage, EditorStyles.wordWrappedLabel);
48+
GUILayout.FlexibleSpace();
49+
}
50+
}
51+
}
52+
}
53+
}

Assets/MRTK/Core/Inspectors/Setup/MRTKVersionPopup.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MRTK/Examples/Demos/PulseShader/Profile/PulseShaderSpatialAwarenessSystemProfile.asset

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,12 @@ MonoBehaviour:
3333
Microsoft.MixedReality.Toolkit.Providers.XRSDK
3434
componentName: XR SDK Spatial Mesh Observer
3535
priority: 0
36-
runtimePlatform: -1
36+
runtimePlatform: 2039
37+
observerProfile: {fileID: 11400000, guid: 4f5009fa6e8234540be72702bb09d29a, type: 2}
38+
- componentType:
39+
reference: Microsoft.MixedReality.Toolkit.XRSDK.OpenXR.OpenXRSpatialAwarenessMeshObserver,
40+
Microsoft.MixedReality.Toolkit.Providers.OpenXR
41+
componentName: OpenXR Spatial Mesh Observer
42+
priority: 0
43+
runtimePlatform: 8
3744
observerProfile: {fileID: 11400000, guid: 4f5009fa6e8234540be72702bb09d29a, type: 2}

Assets/MRTK/Extensions/HandPhysicsService/Examples/HandPhysicsServiceExample.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2344,7 +2344,7 @@ MonoBehaviour:
23442344
m_Script: {fileID: 11500000, guid: 83d9acc7968244a8886f3af591305bcb, type: 3}
23452345
m_Name:
23462346
m_EditorClassIdentifier:
2347-
activeProfile: {fileID: 11400000, guid: fbb8235a0e1db804880e49990996f5a4, type: 2}
2347+
activeProfile: {fileID: 11400000, guid: ec6c5962fb980c041854a25f84d6f2e6, type: 2}
23482348
--- !u!4 &1462653017
23492349
Transform:
23502350
m_ObjectHideFlags: 0

Assets/MRTK/SDK/Editor/Inspectors/UX/Interactable/InteractableInspector.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,26 @@ public static bool TryGetInputActions(out string[] descriptionsArray)
556556
return false;
557557
}
558558

559-
MixedRealityInputAction[] actions = CoreServices.InputSystem.InputSystemProfile.InputActionsProfile.InputActions;
559+
MixedRealityInputSystemProfile inputSystemProfile = CoreServices.InputSystem?.InputSystemProfile;
560560

561-
descriptionsArray = new string[actions.Length];
562-
for (int i = 0; i < actions.Length; i++)
561+
if (inputSystemProfile != null && inputSystemProfile.SpeechCommandsProfile != null)
563562
{
564-
descriptionsArray[i] = actions[i].Description;
563+
MixedRealityInputAction[] actions = inputSystemProfile.InputActionsProfile.InputActions;
564+
565+
descriptionsArray = new string[actions.Length];
566+
for (int i = 0; i < actions.Length; i++)
567+
{
568+
descriptionsArray[i] = actions[i].Description;
569+
}
570+
}
571+
else
572+
{
573+
descriptionsArray = null;
574+
}
575+
576+
if (descriptionsArray == null || descriptionsArray.Length < 1)
577+
{
578+
return false;
565579
}
566580

567581
return true;

Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ private static Ray CalculateRayForSafeZone(
547547
direction = IsPalmFacingCamera(hand) ? direction : -direction;
548548
}
549549

550-
if (hand.ControllerHandedness == Handedness.Right)
550+
if (hand.ControllerHandedness.IsRight())
551551
{
552552
direction = -direction;
553553
}
@@ -672,7 +672,7 @@ private static bool IsPalmFacingCamera(IMixedRealityController hand)
672672
/// </remarks>
673673
private static bool IsApplicableController(IMixedRealityController controller)
674674
{
675-
return controller.ControllerHandedness != Handedness.None;
675+
return !controller.ControllerHandedness.IsNone();
676676
}
677677

678678
/// <summary>

Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraintPalmUp.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ private bool TryGenerateActivationPoint(IMixedRealityHand jointedHand, out Vecto
372372
break;
373373
case SolverSafeZone.UlnarSide:
374374
default:
375-
referenceJoint1 = TrackedHandJoint.IndexKnuckle;
376-
referenceJoint2 = TrackedHandJoint.ThumbProximalJoint;
375+
referenceJoint1 = TrackedHandJoint.PinkyKnuckle;
376+
referenceJoint2 = TrackedHandJoint.Wrist;
377377
break;
378378
}
379379

Assets/MRTK/SDK/Profiles/DefaultMixedRealitySpatialAwarenessSystemProfile.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ MonoBehaviour:
3333
Microsoft.MixedReality.Toolkit.Providers.XRSDK
3434
componentName: XR SDK Spatial Mesh Observer
3535
priority: 0
36-
runtimePlatform: -9
36+
runtimePlatform: 2039
3737
observerProfile: {fileID: 11400000, guid: 8be0bcd2117dd214da41ed98f0def2e3, type: 2}
3838
- componentType:
3939
reference: Microsoft.MixedReality.Toolkit.XRSDK.OpenXR.OpenXRSpatialAwarenessMeshObserver,

0 commit comments

Comments
 (0)