Unity XR SDK는 Unity와 연동되는 자체 XR 공급자를 개발하려는 전문 사용자를 대상으로 합니다.XR SDK를 다운로드하려면 이 페이지에서 액세스를 위해 등록해야 합니다.
XR SDK 패키지를 통해 여러 백엔드(“공급자”라고 부름)가 Unity에서 단일 엔진 기능(“하위 시스템”이라고 부름)을 구현할 수 있습니다. 사용자 애플리케이션은 런타임 시점에 공급자를 선택하고 활성화할 수 있습니다.
단일 하위 시스템은 다음으로 구성됩니다.
하위 시스템 기술자(descriptor)는 하위 시스템을 로드하거나 초기화하기 전에 점검할 수 있는 하위 시스템의 메타데이터입니다. 메타데이터는 매니페스트 파일에서 가져오고 C# 인터페이스를 통해 액세스합니다. Create
메서드는 하위 시스템을 활성화하고 사용자 스크립트에 인스턴스를 제공합니다.
자세한 내용은 하위 시스템의 런타임 발견 및 활성화 페이지를 참조하십시오.
하위 시스템 기술자에서 Create
가 호출되면 하위 시스템 인스턴스가 생성됩니다. 스크립팅 코드는 하위 시스템과 통신하기 위해 이러한 인스턴스와 상호작용합니다. 하위 시스템 자체에는 고유한 라이프사이클이 있으며, 이는 시작, 중지 및 종료할 수 있습니다.
공급자는 하위 시스템의 기본 구현입니다. 하나의 하위 시스템은 여러 공급자를 보유할 수 있습니다. 일부 하위 시스템에서는 여러 공급자를 한 번에 활성화할 수 있지만, 다른 하위 시스템은 상호 배타적일 수 있습니다.
공급자는 Unity 네이티브 플러그인 인터페이스를 준수하며, 일부 추가 라이프사이클 지원이 이를 기반으로 빌드되었습니다. 엔트리 포인트는 UnityPluginLoad
메서드입니다. 여기에서 공급자는 구현하려는 모든 하위 시스템에 등록해야 합니다.
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API
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
&Lifecycle_Initialize,
&Lifecycle_Start,
&Lifecycle_Stop,
&Lifecycle_Shutdown
};
s_XrDisplay->RegisterLifecycleProvider("Provider Plugin Name", "Display0", &displayLifecycleHandler);
// Register with other subsystems...
}
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.