Skip to content

Commit 89711c6

Browse files
author
David Kline
authored
Merge pull request #3421 from Microsoft/beta2-stabilization
Beta2 stabilization -> mrtk development
2 parents 60d299e + 66b3787 commit 89711c6

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Assets/MixedRealityToolkit.Examples/Demos/Solvers/Prefabs/SolverSwappingVolume.prefab

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ MonoBehaviour:
245245
m_Script: {fileID: 11500000, guid: edea428b5e02f9144b45b9fbd5ba5278, type: 3}
246246
m_Name:
247247
m_EditorClassIdentifier:
248+
selectAction:
249+
id: 1
250+
description: Select
251+
axisConstraint: 2
248252
hideThisObject: {fileID: 0}
249253
spawnThisPrefab: {fileID: 0}
250254
updateSolverTargetToClickSource: 1

Assets/MixedRealityToolkit.Examples/Demos/Solvers/Scripts/SwapVolume.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
using Microsoft.MixedReality.Toolkit.Core.Definitions.InputSystem;
45
using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities;
56
using Microsoft.MixedReality.Toolkit.Core.EventDatum.Input;
67
using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem.Handlers;
@@ -15,6 +16,10 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos
1516
/// </summary>
1617
public class SwapVolume : MonoBehaviour, IMixedRealityPointerHandler
1718
{
19+
[SerializeField]
20+
[Tooltip("The action to activate or deactivate the swapping volume.")]
21+
private MixedRealityInputAction selectAction = MixedRealityInputAction.None;
22+
1823
[SerializeField]
1924
[Tooltip("The scene object to be hidden when the active solver is enabled.")]
2025
private GameObject hideThisObject = null;
@@ -53,6 +58,11 @@ public void OnPointerDown(MixedRealityPointerEventData eventData) { }
5358

5459
public void OnPointerClicked(MixedRealityPointerEventData eventData)
5560
{
61+
if (eventData.MixedRealityInputAction != selectAction)
62+
{
63+
return;
64+
}
65+
5666
if (spawnedObject.activeSelf)
5767
{
5868
spawnedObject.SetActive(false);
@@ -72,6 +82,10 @@ public void OnPointerClicked(MixedRealityPointerEventData eventData)
7282
{
7383
solverHandler.TrackedObjectToReference = TrackedObjectType.MotionControllerLeft;
7484
}
85+
else
86+
{
87+
solverHandler.TrackedObjectToReference = TrackedObjectType.Head;
88+
}
7589
}
7690

7791
hideThisObject.SetActive(false);

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealitySpatialMeshObserver.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ private void CleanupObserver()
304304
if (Application.isPlaying)
305305
{
306306
// Cleanup the scene objects are managing
307-
if (ObservedObjectParent != null)
307+
if (observedObjectParent != null)
308308
{
309-
ObservedObjectParent.transform.DetachChildren();
309+
observedObjectParent.transform.DetachChildren();
310310
}
311+
311312
foreach (SpatialAwarenessMeshObject meshObject in meshes.Values)
312313
{
313314
if (meshObject != null)

0 commit comments

Comments
 (0)