Spatial.IsSupported
static bool IsSupported(SpatialCapability capabilities)
Does the current device support all of these capabilities? This is false until an XR session with spatial entity support has initialized.
| SpatialCapability capabilities | One or more capabilities to check. |
| RETURNS: bool | True if every capability given is supported. |
static bool IsSupported(SpatialCapability capability, SpatialComponent components)
Can this capability provide all of these components on this device? Handy for optional data like labels, which some devices don’t provide.
| SpatialCapability capability | A single capability to look up. |
| SpatialComponent components | One or more components to check. |
| RETURNS: bool | True if the capability can provide every component given. |
Examples
Checking what the device supports
Supported is what the device can do, Requested is what’s been asked for, and Running is what’s started up and working right now.
static bool CanFindTables()
=> Spatial.IsSupported(SpatialCapability.PlaneTracking, SpatialComponent.Label);
static string PlaneStatus()
{
if (Spatial.IsRunning (SpatialCapability.PlaneTracking)) return "Finding planes";
if (Spatial.IsRequested(SpatialCapability.PlaneTracking)) return "Starting up...";
return "Plane tracking is off";
}
Found an issue with these docs, or have some additional questions? Create an Issue on Github!