docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRSessionSubsystem.Provider

    The API this subsystem uses to interop with different provider implementations.

    Inheritance
    object
    SubsystemProvider
    SubsystemProvider<XRSessionSubsystem>
    XRSessionSubsystem.Provider
    Inherited Members
    SubsystemProvider<XRSessionSubsystem>.TryInitialize()
    SubsystemProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public class XRSessionSubsystem.Provider : SubsystemProvider<XRSessionSubsystem>

    Properties

    currentTrackingMode

    Get the current tracking mode (for example, the AnyTrackingMode bits).

    Declaration
    public virtual Feature currentTrackingMode { get; }
    Property Value
    Type Description
    Feature

    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
    int

    matchFrameRateEnabled

    Whether the AR session update is synchronized with the Unity frame rate. If true, Update(XRSessionUpdateParams) will block until the next AR frame is available.

    Declaration
    public virtual bool matchFrameRateEnabled { get; }
    Property Value
    Type Description
    bool

    matchFrameRateRequested

    Whether the AR session update should be 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 matchFrameRateRequested { get; set; }
    Property Value
    Type Description
    bool

    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

    requestedFeatures

    Should return the features requested by the enabling of other Subsystems.

    Declaration
    public virtual Feature requestedFeatures { get; }
    Property Value
    Type Description
    Feature

    requestedTrackingMode

    Get or set the requested tracking mode (for example, the AnyTrackingMode bits).

    Declaration
    public virtual Feature requestedTrackingMode { get; set; }
    Property Value
    Type Description
    Feature

    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 override void Destroy()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.ARSubsystems.XRSessionSubsystem>.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.

    GetConfigurationDescriptors(Allocator)

    This getter should allocate a new NativeArray using allocator and populate it with the supported ConfigurationDescriptors.

    Declaration
    public virtual NativeArray<ConfigurationDescriptor> GetConfigurationDescriptors(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    The Allocator to use to create the returned NativeArray.

    Returns
    Type Description
    NativeArray<ConfigurationDescriptor>

    A newly allocated NativeArray of ConfigurationDescriptors that describes the capabilities of all the supported configurations.

    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()

    Reset()

    Reset the session. The behavior should be equivalent to destroying and recreating the session.

    Declaration
    public virtual void Reset()

    Start()

    Invoked to start or resume a session. This is different from OnApplicationResume().

    Declaration
    public override void Start()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.ARSubsystems.XRSessionSubsystem>.Start()

    Stop()

    Invoked to pause a running session. This is different from OnApplicationPause().

    Declaration
    public override void Stop()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.ARSubsystems.XRSessionSubsystem>.Stop()

    Update(XRSessionUpdateParams)

    Perform any per-frame update logic here.

    Declaration
    public virtual void Update(XRSessionUpdateParams updateParams)
    Parameters
    Type Name Description
    XRSessionUpdateParams updateParams

    Parameters about the current state that may be needed to inform the session.

    Update(XRSessionUpdateParams, Configuration)

    Perform any per-frame update logic here. The session should use the configuration indicated by configuration.descriptor.identifier.descriptor.identifier, which should be one of the ones returned by GetConfigurationDescriptors(Allocator).

    Declaration
    public virtual void Update(XRSessionUpdateParams updateParams, Configuration configuration)
    Parameters
    Type Name Description
    XRSessionUpdateParams updateParams

    Parameters about the current state that might be needed to inform the session.

    Configuration configuration

    The configuration the session should use.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)