Skip to content

Commit 8a93b62

Browse files
a few tweaks and updated Viz Demo Scene
1 parent bcb8230 commit 8a93b62

File tree

3 files changed

+20
-35
lines changed

3 files changed

+20
-35
lines changed

Assets/MixedRealityToolkit-Examples/Demos/Boundary/Scenes/BoundaryVisualization.unity

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ GameObject:
338338
m_Component:
339339
- component: {fileID: 353698135}
340340
- component: {fileID: 353698136}
341-
- component: {fileID: 353698138}
342-
- component: {fileID: 353698137}
343341
m_Layer: 0
344342
m_Name: BoundaryVisualizer
345343
m_TagString: Untagged
@@ -371,30 +369,6 @@ MonoBehaviour:
371369
m_Script: {fileID: 11500000, guid: 647fd3dd3cb11e749850897a69f040db, type: 3}
372370
m_Name:
373371
m_EditorClassIdentifier:
374-
--- !u!114 &353698137
375-
MonoBehaviour:
376-
m_ObjectHideFlags: 0
377-
m_PrefabParentObject: {fileID: 0}
378-
m_PrefabInternal: {fileID: 0}
379-
m_GameObject: {fileID: 353698134}
380-
m_Enabled: 1
381-
m_EditorHideFlags: 0
382-
m_Script: {fileID: 11500000, guid: 3bfc11696910c3a4a95bec35024e1ce0, type: 3}
383-
m_Name:
384-
m_EditorClassIdentifier:
385-
isPlayAreaVisualized: 1
386-
--- !u!114 &353698138
387-
MonoBehaviour:
388-
m_ObjectHideFlags: 0
389-
m_PrefabParentObject: {fileID: 0}
390-
m_PrefabInternal: {fileID: 0}
391-
m_GameObject: {fileID: 353698134}
392-
m_Enabled: 1
393-
m_EditorHideFlags: 0
394-
m_Script: {fileID: 11500000, guid: 85c42b1383d59b344b03d394b4d43861, type: 3}
395-
m_Name:
396-
m_EditorClassIdentifier:
397-
isFloorPlaneVisualized: 1
398372
--- !u!1 &1229001241
399373
GameObject:
400374
m_ObjectHideFlags: 0

Assets/MixedRealityToolkit-SDK/Features/Boundary/Scripts/MixedRealityBoundarySystem.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,24 @@ public bool EnablePlatformBoundaryRendering
106106

107107
if (value)
108108
{
109-
CreateFloorPlaneVisualization();
110-
CreatePlaySpaceVisualization();
109+
if (Application.isPlaying)
110+
{
111+
CreateFloorPlaneVisualization();
112+
CreatePlaySpaceVisualization();
113+
}
111114
}
112115
else
113116
{
114-
Object.Destroy(currentPlayArea);
115-
Object.Destroy(currentFloorPlane);
117+
if (Application.isEditor)
118+
{
119+
Object.DestroyImmediate(currentPlayArea);
120+
Object.DestroyImmediate(currentFloorPlane);
121+
}
122+
else
123+
{
124+
Object.Destroy(currentPlayArea);
125+
Object.Destroy(currentFloorPlane);
126+
}
116127
}
117128
}
118129
}
@@ -218,7 +229,7 @@ public GameObject CreatePlaySpaceVisualization()
218229
if (EdgeUtilities.IsValidPoint(center))
219230
{
220231
currentPlayArea = GameObject.CreatePrimitive(PrimitiveType.Quad);
221-
currentPlayArea.name = "Boundary System Play Area Visualization";
232+
currentPlayArea.name = "Boundary System Play Area";
222233
currentPlayArea.transform.Translate(new Vector3(center.x, 0.005f, center.y)); // Add fudge factor to avoid z-fighting
223234
currentPlayArea.transform.Rotate(new Vector3(90, -angle, 0));
224235
currentPlayArea.transform.localScale = new Vector3(width, height, 1.0f);
@@ -238,6 +249,7 @@ public GameObject CreateFloorPlaneVisualization()
238249

239250
// Render the floor.
240251
currentFloorPlane = GameObject.CreatePrimitive(PrimitiveType.Quad);
252+
currentFloorPlane.name = "Boundary System Floor Plane";
241253
currentFloorPlane.transform.Translate(Vector3.zero);
242254
currentFloorPlane.transform.Rotate(90, 0, 0);
243255
currentFloorPlane.transform.localScale = MixedRealityManager.Instance.ActiveProfile.BoundaryVisualizationProfile.FloorPlaneScale;

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealityConfigurationProfile.asset

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ MonoBehaviour:
1212
m_Name: DefaultMixedRealityConfigurationProfile
1313
m_EditorClassIdentifier:
1414
initialManagerTypes:
15-
- reference: Microsoft.MixedReality.Toolkit.SDK.Input.MixedRealityInputManager,
16-
Microsoft.MixedReality.Toolkit.SDK
1715
- reference: Microsoft.MixedReality.Toolkit.SDK.BoundarySystem.MixedRealityBoundaryManager,
1816
Microsoft.MixedReality.Toolkit.SDK
17+
- reference: Microsoft.MixedReality.Toolkit.SDK.Input.MixedRealityInputManager,
18+
Microsoft.MixedReality.Toolkit.SDK
1919
targetExperienceScale: 3
2020
enableCameraProfile: 1
2121
cameraProfile: {fileID: 11400000, guid: b9a895b32a50a7f45b1e4da728d50741, type: 2}
@@ -35,7 +35,6 @@ MonoBehaviour:
3535
boundarySystemType:
3636
reference: Microsoft.MixedReality.Toolkit.SDK.BoundarySystem.MixedRealityBoundaryManager,
3737
Microsoft.MixedReality.Toolkit.SDK
38-
boundaryHeight: 3
39-
enablePlatformBoundaryRendering: 1
38+
enablePlatformBoundaryRendering: 0
4039
boundaryVisualizationProfile: {fileID: 11400000, guid: c1f4aa213e301a446aca3858e6f4ad17,
4140
type: 2}

0 commit comments

Comments
 (0)