File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Assets/MRTK/Services/DiagnosticsSystem Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public bool IsVisible
58
58
59
59
private bool ShouldShowProfiler =>
60
60
#if WINDOWS_UWP
61
- ( appCapture == null || ! appCapture . IsCapturingVideo || showProfilerDuringMRC ) &&
61
+ ( ! appCaptureIsCapturingVideo || showProfilerDuringMRC ) &&
62
62
#endif // WINDOWS_UWP
63
63
isVisible ;
64
64
@@ -217,6 +217,7 @@ private struct FrameRateColor
217
217
private Mesh quadMesh ;
218
218
219
219
#if WINDOWS_UWP
220
+ private bool appCaptureIsCapturingVideo = false ;
220
221
private AppCapture appCapture ;
221
222
#endif // WINDOWS_UWP
222
223
@@ -289,11 +290,22 @@ private void Start()
289
290
290
291
#if WINDOWS_UWP
291
292
appCapture = AppCapture . GetForCurrentView ( ) ;
293
+ if ( appCapture != null )
294
+ {
295
+ appCapture . CapturingChanged += AppCapture_CapturingChanged ;
296
+ }
292
297
#endif // WINDOWS_UWP
293
298
}
294
299
295
300
private void OnDestroy ( )
296
301
{
302
+ #if WINDOWS_UWP
303
+ if ( appCapture != null )
304
+ {
305
+ appCapture . CapturingChanged -= AppCapture_CapturingChanged ;
306
+ }
307
+ #endif // WINDOWS_UWP
308
+
297
309
if ( window != null )
298
310
{
299
311
Destroy ( window . gameObject ) ;
@@ -442,6 +454,10 @@ private void LateUpdate()
442
454
}
443
455
}
444
456
457
+ #if WINDOWS_UWP
458
+ private void AppCapture_CapturingChanged ( AppCapture sender , object args ) => appCaptureIsCapturingVideo = sender . IsCapturingVideo ;
459
+ #endif // WINDOWS_UWP
460
+
445
461
private static readonly ProfilerMarker CalculateWindowPositionPerfMarker = new ProfilerMarker ( "[MRTK] MixedRealityToolkitVisualProfiler.CalculateWindowPosition" ) ;
446
462
447
463
private Vector3 CalculateWindowPosition ( Transform cameraTransform )
You can’t perform that action at this time.
0 commit comments