File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Assets/MRTK/Providers/XRSDK Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,24 @@ protected virtual bool? IsActiveLoader
5252 && XRGeneralSettings . Instance . Manager != null
5353 && XRGeneralSettings . Instance . Manager . activeLoader != null )
5454 {
55+ if ( ( observersCache == null || observersCache . Count == 0 )
56+ && Service is IMixedRealityDataProviderAccess spatialAwarenessDataProviderAccess
57+ && Service is IMixedRealityServiceState spatialAwarenessState
58+ && spatialAwarenessState . IsInitialized )
59+ {
60+ observersCache = spatialAwarenessDataProviderAccess . GetDataProviders < GenericXRSDKSpatialMeshObserver > ( ) ;
61+ }
62+
63+ // Don't report ourselves as active if another observer is handling this platform
64+ for ( int i = 0 ; i < observersCache ? . Count ; i ++ )
65+ {
66+ GenericXRSDKSpatialMeshObserver observer = observersCache [ i ] ;
67+ if ( observer != this && ( observer . IsActiveLoader ?? false ) )
68+ {
69+ return false ;
70+ }
71+ }
72+
5573 return true ;
5674 }
5775
You can’t perform that action at this time.
0 commit comments