Skip to content

Commit b5f4780

Browse files
committed
Use built-in IsInitialized
1 parent 43b3b1e commit b5f4780

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Assets/MRTK/Core/Services/BaseBoundarySystem.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ private void ReadProfile()
5959
/// <inheritdoc/>
6060
public override string Name { get; protected set; } = "Mixed Reality Boundary System";
6161

62-
private bool boundarySystemInitialized = false;
63-
6462
/// <inheritdoc/>
6563
public override void Initialize()
6664
{
67-
base.Initialize();
65+
// Initialize this value earlier than other systems, so we can use it to block boundary events being raised too early
66+
IsInitialized = false;
6867

6968
// The profile needs to be read on initialization to ensure that re-initialization
7069
// after profile change reads the correct data.
@@ -77,7 +76,7 @@ public override void Initialize()
7776
SetTrackingSpace();
7877
CalculateBoundaryBounds();
7978

80-
boundarySystemInitialized = true;
79+
base.Initialize();
8180

8281
RefreshVisualization();
8382
RaiseBoundaryVisualizationChanged();
@@ -527,7 +526,7 @@ private void PropertyAction(bool value, GameObject boundaryObject, System.Action
527526
{
528527
// If not done initializing, no need to raise the changed event or check the visualization.
529528
// These will both happen at the end of the initialization flow.
530-
if (!boundarySystemInitialized)
529+
if (!IsInitialized)
531530
{
532531
return;
533532
}

0 commit comments

Comments
 (0)