Class XRSessionSubsystem
This subsystem controls the lifecycle of an XR session. Some platforms, particularly those that have non-XR modes, need to be able to turn the session on and off to enter and exit XR modes of operation.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: solution.dll
Syntax
public class XRSessionSubsystem : SubsystemWithProvider<XRSessionSubsystem, XRSessionSubsystemDescriptor, XRSessionSubsystem.Provider>, ISubsystem
Constructors
Name | Description |
---|---|
XRSessionSubsystem() | Do not call this directly. Call create on a valid XRSessionSubsystemDescriptor instead. |
Properties
Name | Description |
---|---|
configurationChooser | Get or set the ConfigurationChooser used by
DetermineConfiguration(Feature).
If set to |
currentConfiguration | The current Configuration in use by the session. |
currentTrackingMode | Get the current tracking mode in use by the subsystem. |
frameRate | The native update rate of the AR Session. |
matchFrameRateEnabled | Whether the AR session update is synchronized with the Unity frame rate.
If |
matchFrameRateRequested | Get or set whether the match frame rate feature should be enabled. When enabled, the AR session update is synchronized with the Unity frame rate. |
nativePtr | Returns an implementation-defined pointer associated with the session. |
notTrackingReason | Gets the NotTrackingReason for the session. |
requestedFeatures | Get the requested Features. These are used to determine the session's Configuration. |
requestedTrackingMode | The requested tracking mode. Query for support with |
sessionId | Returns a unique session identifier for this session. |
trackingState | Gets the TrackingState for the session. |
Methods
Name | Description |
---|---|
DetermineConfiguration(Feature) | Determines the Configuration the session will use given the requested |
GetAvailabilityAsync() | Asynchronously retrieves the SessionAvailability. Used to determine whether the current device supports XR and if the necessary software is installed. |
GetConfigurationDescriptors(Allocator) | Get the list of supported configuration descriptors. The session can have multiple, discrete modes of operation. A configuration represents the capabilities of a mode of operation, which can be a subset of the session's overal capabilities. That is, the session might support many features, but not all at the same time. This is used by DetermineConfiguration(Feature) to determine the best configuration given a set of requested features. |
InstallAsync() | Asynchronously attempts to install XR software on the current device.
Throws if supportsInstall is |
OnApplicationPause() | Should be invoked when the application is paused. |
OnApplicationResume() | Should be invoked when the application is resumed. |
Reset() | Restarts a session. Stop and Start
pause and resume a session, respectively. |
Update(XRSessionUpdateParams) | Trigger the session's update loop. |