Class ARSession
Controls the lifecycle and configuration options for an AR session. There is only one active session. If you have multiple ARSession components, they all communicate to the same session and will conflict with each other.
Enabling or disabling the ARSession starts or stops the session, respectively.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[DefaultExecutionOrder(-2147483648)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARSession.html")]
public sealed class ARSession : SubsystemLifecycleManager<XRSessionSubsystem, XRSessionSubsystemDescriptor, XRSessionSubsystem.Provider>
Properties
Name | Description |
---|---|
attemptUpdate | If the device supports XR but does not have the necessary software, some platforms
allow prompting the user to install or update the software. If attemptUpdate
is |
currentTrackingMode | Get the current |
frameRate | Get the number of AR frames produced per second, or null if the frame rate cannot be determined. |
matchFrameRate | If |
matchFrameRateEnabled | If |
matchFrameRateRequested | If |
notTrackingReason | The reason AR tracking was lost. |
requestedTrackingMode | Get or set the |
state | The state of the entire system. Use this to determine the status of AR availability and installation. |
Methods
Name | Description |
---|---|
CheckAvailability() | Start checking the availability of XR on the current device. |
Install() | Begin installing AR software on the current device (if supported). |
OnDestroy() | Invoked when this |
OnDisable() | Invoked when this |
OnEnable() | Creates and initializes the session subsystem. Begins checking for availability. |
Reset() | Resets the AR Session. |
Events
Name | Description |
---|---|
stateChanged | This event is invoked whenever the state changes. |