Class VisionOS
Runtime scripting API for VisionOS.
Inherited Members
Namespace: UnityEngine.XR.VisionOS
Assembly: Unity.XR.VisionOS.dll
Syntax
public static class VisionOS
Methods
IsImmersiveSpaceReady()
Determine whether the immersive space for the app is ready. Return true in the Editor for testing purposes.
Declaration
public static bool IsImmersiveSpaceReady()
Returns
Type | Description |
---|---|
bool | true if the immersive space is ready (or in the Editor when targeting visionOS). Otherwise, false. |
IsSimulator()
Determine whether the app is running in the visionOS simulator. Treat the Editor targeting visionOS as running in simulator.
Declaration
public static bool IsSimulator()
Returns
Type | Description |
---|---|
bool | true if the app is running in the visionOS Simulator. Otherwise, false. |
QueryAuthorizationStatus(VisionOSAuthorizationType)
Query the current authorization status for a given authorization type.
Declaration
public static VisionOSAuthorizationStatus QueryAuthorizationStatus(VisionOSAuthorizationType type)
Parameters
Type | Name | Description |
---|---|---|
VisionOSAuthorizationType | type | The authorization type to query. |
Returns
Type | Description |
---|---|
VisionOSAuthorizationStatus | The status of the queried authorization type. |
SetDepthRange(float, float)
Set the range of values used for depth sorting. These values should match Camera.nearClipPlane and Camera.farClipPlane
Declaration
public static void SetDepthRange(float near, float far)
Parameters
Type | Name | Description |
---|---|---|
float | near | The value for the near clipping plane. |
float | far | The value for the far clipping plane. |
Events
AuthorizationChanged
Called when an ARKit authorization like hand tracking or world tracking changes status. Some examples of when this occurs:
- On app start when initially querying the authorization status, if it was already requested
- After querying authorization status, if it was not requested and the user allowed or declined
- When the user changes authorizations in Settings and returns to the app
Declaration
public static event Action<VisionOSAuthorizationEventArgs> AuthorizationChanged
Event Type
Type | Description |
---|---|
Action<VisionOSAuthorizationEventArgs> |