Skip to content

Commit

Permalink
Add ProfilerMarker
Browse files Browse the repository at this point in the history
  • Loading branch information
keveleigh committed Aug 11, 2020
1 parent 8b74632 commit 064ab8b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions Assets/MRTK/Extensions/LostTrackingService/LostTrackingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,29 @@ public override void Initialize()
}

#else
private static readonly ProfilerMarker UpdatePerfMarker = new ProfilerMarker("[MRTK] LostTrackingService.Update");

/// <inheritdoc />
public override void Update()
{
NativeTypes.SpatialLocatability newLocatabilityState = XRSubsystemHelpers.InputSubsystem.GetSpatialLocatability();

if (newLocatabilityState != lastLocatabilityState)
using (UpdatePerfMarker.Auto())
{
switch (newLocatabilityState)
NativeTypes.SpatialLocatability newLocatabilityState = XRSubsystemHelpers.InputSubsystem.GetSpatialLocatability();

if (newLocatabilityState != lastLocatabilityState)
{
case NativeTypes.SpatialLocatability.PositionalTrackingInhibited:
SetTrackingLost(true);
break;
default:
SetTrackingLost(false);
break;
}
switch (newLocatabilityState)
{
case NativeTypes.SpatialLocatability.PositionalTrackingInhibited:
SetTrackingLost(true);
break;
default:
SetTrackingLost(false);
break;
}

lastLocatabilityState = newLocatabilityState;
lastLocatabilityState = newLocatabilityState;
}
}
}
#endif // !WMR_ENABLED
Expand Down

0 comments on commit 064ab8b

Please sign in to comment.