Skip to content

Commit 5a09d57

Browse files
author
David Kline
authored
Merge pull request #9995 from davidkline-ms/observationParent
Make the ObservedObjectParent public via the BaseSpatialObserver class
2 parents 8acbb64 + 4916ee2 commit 5a09d57

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

Assets/MRTK/Core/Providers/BaseSpatialMeshObserver.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ protected BaseSpatialMeshObserver(
3232

3333
protected MixedRealitySpatialAwarenessEventData<SpatialAwarenessMeshObject> meshEventData = null;
3434

35-
private GameObject observedObjectParent = null;
36-
37-
/// <summary>
38-
/// The parent GameObject for all observed meshes to be placed under.
39-
/// </summary>
40-
protected virtual GameObject ObservedObjectParent => observedObjectParent != null ? observedObjectParent : (observedObjectParent = Service?.CreateSpatialAwarenessObservationParent(Name));
41-
4235
protected virtual void ReadProfile()
4336
{
4437
if (ConfigurationProfile == null)

Assets/MRTK/Core/Providers/BaseSpatialObserver.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ protected BaseSpatialObserver(
4040
[System.Obsolete("Call Service instead.")]
4141
protected IMixedRealitySpatialAwarenessSystem SpatialAwarenessSystem => Service;
4242

43+
private GameObject observedObjectParent = null;
44+
protected virtual GameObject ObservedObjectParent => observedObjectParent != null ? observedObjectParent : (observedObjectParent = Service?.CreateSpatialAwarenessObservationParent(Name));
45+
46+
/// <summary>
47+
/// The parent GameObject for all observed meshes to be placed under.
48+
/// </summary>
49+
public GameObject ObservationParent => ObservedObjectParent;
50+
4351
/// <summary>
4452
/// Creates the spatial observer and handles the desired startup behavior.
4553
/// </summary>

Assets/MRTK/Providers/Experimental/WindowsSceneUnderstanding/WindowsSceneUnderstandingObserver.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,9 @@ public TextAsset SerializedScene
380380

381381
#if SCENE_UNDERSTANDING_PRESENT && UNITY_WSA
382382

383-
#region Other Property
384-
protected virtual GameObject ObservedObjectParent => observedObjectParent != null ? observedObjectParent : (observedObjectParent = Service?.CreateSpatialAwarenessObservationParent("WindowsMixedRealitySceneUnderstandingObserver"));
385-
#endregion Other Property
386-
387383
#region Private Fields
388384
private Task task;
389385
private readonly Dictionary<int, SpatialAwarenessSceneObject> sceneObjects = new Dictionary<int, SpatialAwarenessSceneObject>(256);
390-
private GameObject observedObjectParent = null;
391386
private System.Timers.Timer firstUpdateTimer = null;
392387
private System.Timers.Timer updateTimer = null;
393388
private Dictionary<int, Tuple<SceneQuad, SceneObject>> cachedSceneQuads = new Dictionary<int, Tuple<SceneQuad, SceneObject>>(256);

0 commit comments

Comments
 (0)