XR 씬을 설정하려면 XR 원점을 추가합니다.
이러한 오브젝트는 씬 카메라 컨트롤을 비롯한 공간 트래킹 데이터를 씬으로 변환하기 위한 레퍼런스 프레임을 제공하는 게임 오브젝트 및 컴포넌트의 컬렉션입니다.XR 원점을 씬에 추가하면 연결된 카메라를 컨트롤하여 사용자의 헤드 마운티 기기(VR)나 핸드 헬드 기기(AR)를 추적합니다.또한 컨트롤러의 게임 오브젝트를 포함하는 XR 원점의 버전은 사용자의 컨트롤러를 추적하도록 게임오브젝트를 이동합니다.
참고:
씬에서 사용할 수 있는 XR Origin 옵션에 대한 설명인 XR Origin을 참조하십시오.
XR의 씬을 설정하기 전에 먼저 다음을 수행해야 합니다.
XR의 씬을 설정하는 단계는 다음과 같습니다.
AR 프로젝트의 경우 AR Foundation 매뉴얼의 씬 설정에서 추가 설정 단계와 자세한 지침을 참조하십시오.
XR 인터랙션 툴킷을 사용하는 VR 프로젝트의 경우 인터랙션 툴킷 매뉴얼의 일반 설정에서 자세한 내용을 참조하십시오.
XR 컨텍스트와 비XR 컨텍스트 모두에서 사용할 수 있는 씬이 있는 경우 XRSettings.enabled 프로퍼티를 사용하여 XR 보조 시스템이 현재 로드되고 활성화되어 있는지 감지할 수 있습니다.이 정보를 사용하면 적절한 게임 오브젝트 및 컴포넌트 세트를 활성화하거나 비활성화할 수 있습니다.
public void CheckXRStatus()
{
if (UnityEngine.XR.XRSettings.enabled)
{
Debug.Log("XR is active.");
}
else
{
Debug.Log("XR is not available.");
}
}
참고: XRSettings.enabled 프로퍼티의 값을 읽어 XR 상태를 확인할 수 있습니다.그러나 값을 설정하는 것은 더 이상 지원되지 않으며 아무 효과가 없습니다.런타임 시 XR을 동적으로 켜고 끄는 방법에 대한 내용은 수동으로 XR 로더 수명 주기 관리를 참조하십시오.
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.