Skip to content

Commit 7b7c2e7

Browse files
committed
Change time in Spatial Mapping to unscaledTime
Unscaled time allows Spatial Mapping to continue while the physics are paused.
1 parent 3f3cafb commit 7b7c2e7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Assets/HoloToolkit/SpatialMapping/Scripts/SpatialMappingManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void StartObserver()
212212
if (!IsObserverRunning())
213213
{
214214
surfaceObserver.StartObserving();
215-
StartTime = Time.time;
215+
StartTime = Time.unscaledTime;
216216
}
217217
}
218218

Assets/HoloToolkit/SpatialMapping/Scripts/SpatialMappingObserver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ private void Update()
150150
ReclaimSurface(newSurface);
151151
}
152152
}
153-
else if ((Time.time - updateTime) >= TimeBetweenUpdates)
153+
else if ((Time.unscaledTime - updateTime) >= TimeBetweenUpdates)
154154
{
155155
observer.Update(SurfaceObserver_OnSurfaceChanged);
156-
updateTime = Time.time;
156+
updateTime = Time.unscaledTime;
157157
}
158158
}
159159
}

Assets/HoloToolkit/SpatialMapping/Tests/Scripts/SpatialProcessingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private void Update()
4848
{
4949
// Check to see if enough scanning time has passed
5050
// since starting the observer.
51-
if ((Time.time - SpatialMappingManager.Instance.StartTime) < scanTime)
51+
if ((Time.unscaledTime - SpatialMappingManager.Instance.StartTime) < scanTime)
5252
{
5353
// If we have a limited scanning time, then we should wait until
5454
// enough time has passed before processing the mesh.

0 commit comments

Comments
 (0)