Skip to content

Commit d147fb1

Browse files
committed
Update PlatformHandMeshVisualizer.cs
1 parent a1a0993 commit d147fb1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

org.mixedrealitytoolkit.input/Visualizers/PlatformHandVisualizer/PlatformHandMeshVisualizer.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ public class PlatformHandMeshVisualizer : HandMeshVisualizer
2525

2626
#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID)
2727
private HandMeshTracker handMeshTracker;
28-
#endif
29-
3028
private Mesh neutralPoseMesh;
3129
private bool initializedUVs = false;
30+
#endif
3231

3332
private XRMeshSubsystem meshSubsystem = null;
3433
private readonly List<MeshInfo> meshInfos = new List<MeshInfo>();
@@ -40,11 +39,6 @@ protected override void OnEnable()
4039

4140
handRenderer.enabled = false;
4241

43-
if (neutralPoseMesh == null)
44-
{
45-
neutralPoseMesh = new Mesh();
46-
}
47-
4842
#if UNITY_OPENXR_PRESENT
4943
if (UnityEngine.XR.OpenXR.OpenXRRuntime.IsExtensionEnabled("XR_ANDROID_hand_mesh"))
5044
{
@@ -65,6 +59,11 @@ protected override void OnEnable()
6559
#if MROPENXR_PRESENT && (UNITY_STANDALONE_WIN || UNITY_WSA || UNITY_ANDROID)
6660
Debug.Log($"Using XR_MSFT_hand_tracking_mesh for {HandNode} visualization.");
6761
handMeshTracker = HandNode == XRNode.LeftHand ? HandMeshTracker.Left : HandMeshTracker.Right;
62+
63+
if (neutralPoseMesh == null)
64+
{
65+
neutralPoseMesh = new Mesh();
66+
}
6867
#endif
6968
}
7069
else

0 commit comments

Comments
 (0)