Class XRSessionSubsystem.IProvider
The API this subsystem uses to interop with different provider implementations.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
protected class IProvider
Properties
frameRate
The native update rate of the AR Session. Must be implemented if
supportsMatchFrameRate
is True.
Declaration
public virtual int frameRate { get; }
Property Value
| Type | Description | 
|---|---|
| Int32 | 
matchFrameRate
Whether the AR session update is synchronized with the Unity frame rate.
If true, Update(XRSessionUpdateParams) should block until the next AR frame is available.
Must be implemented if
supportsMatchFrameRate
is True.
Declaration
public virtual bool matchFrameRate { get; set; }
Property Value
| Type | Description | 
|---|---|
| Boolean | 
nativePtr
Get a pointer to an object associated with the session. Callers should be able to manipulate the session in their own code using this.
Declaration
public virtual IntPtr nativePtr { get; }
Property Value
| Type | Description | 
|---|---|
| IntPtr | 
notTrackingReason
Get the NotTrackingReason for the session.
Declaration
public virtual NotTrackingReason notTrackingReason { get; }
Property Value
| Type | Description | 
|---|---|
| NotTrackingReason | 
sessionId
Get a unique identifier for this session
Declaration
public virtual Guid sessionId { get; }
Property Value
| Type | Description | 
|---|---|
| Guid | 
trackingState
Get the TrackingState for the session.
Declaration
public virtual TrackingState trackingState { get; }
Property Value
| Type | Description | 
|---|---|
| TrackingState | 
Methods
Destroy()
Stop the session and destroy all associated resources.
Declaration
public virtual void Destroy()
GetAvailabilityAsync()
Get the session's availability, such as whether the platform supports XR.
Declaration
public virtual Promise<SessionAvailability> GetAvailabilityAsync()
Returns
| Type | Description | 
|---|---|
| Promise<SessionAvailability> | A Promise<T> that the caller can yield on until availability is determined.  | 
InstallAsync()
Attempt to update or install necessary XR software. Will only be called if supportsInstall is true.
Declaration
public virtual Promise<SessionInstallationStatus> InstallAsync()
Returns
| Type | Description | 
|---|---|
| Promise<SessionInstallationStatus> | 
OnApplicationPause()
Invoked when the application is paused.
Declaration
public virtual void OnApplicationPause()
OnApplicationResume()
Invoked when the application is resumed.
Declaration
public virtual void OnApplicationResume()
Pause()
Invoked to pause a running session. This is different from OnApplicationPause().
Declaration
public virtual void Pause()
Reset()
Reset the session. The behavior should be equivalent to destroying and recreating the session.
Declaration
public virtual void Reset()
Resume()
Invoked to start or resume a session. This is different from OnApplicationResume().
Declaration
public virtual void Resume()
Update(XRSessionUpdateParams)
Perform any per-frame update logic here.
Declaration
public virtual void Update(XRSessionUpdateParams updateParams)
Parameters
| Type | Name | Description | 
|---|---|---|
| XRSessionUpdateParams | updateParams | Paramters about the current state that may be needed to inform the session.  |