Version: 2022.2
Language : English
VR frame timing
Creating an XR provider

Unity XR SDK

The Unity XR SDK is aimed at specialist users who want to develop their own XR providers that work with Unity. To download XR SDK, you must sign up for access on this page.

The XR SDK package allows multiple backends (called “providers”) to implement a single engine feature (called a “subsystem”) in Unity. User applications can select and activate providers at runtime.


A single subsystem consists of:

  • A developer-facing C# interface
  • A native interface that multiple backends (Providers) implement via dynamic libraries
  • Common engine code which handles communicating with the C# interface, the native interface, and the rest of the engine

Subsystem diagram

Subsystem descriptor

A subsystem descriptor is metadata about a subsystem which can be inspected before loading or initializing a subsystem. This comes from a manifest file and is accessed via a C# interface. A Create method activates the subsystem and provides an instance of it to the user’s scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary

For more information, see the Runtime discovery and activation of subsystems page.

Subsystem instance

When Create is called on a subsystem descriptor, this creates a subsystem instance. Scripting code interacts with these instances in order to communicate with the subsystem. The subsystem itself has its own lifecycle: it can be started, stopped, and shut down.


A provider is the native implementation of a subsystem. One subsystem can have multiple providers. Some subsystems can allow multiple providers to be active at a time, but others might be mutually exclusive.

Provider diagram
Provider diagram

Providers conform to the Unity native plug-in interface, with some additional lifecycle support built on top. The entry point is the UnityPluginLoad method. From there, the provider must register with all subsystems it intends to implement.

UnityPluginLoad(IUnityInterfaces* unityInterfaces)
    s_XrDisplay = unityInterfaces->Get<IUnityXRDisplayInterface>();
    UnityLifecycleProvider displayLifecycleHandler =
        NULL, // This can be any object you want to be passed as userData to the following functions
    s_XrDisplay->RegisterLifecycleProvider("Provider Plugin Name", "Display0", &displayLifecycleHandler);

    // Register with other subsystems...
VR frame timing
Creating an XR provider
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。