오큘러스 리프트(Oculus Rift)에는 세 개의 입력이 있습니다. 오큘러스 터치 컨트롤러 두 개와 오큘러스 리모트 한 개가 바로 그것입니다. Unity 에디터의 네이티브 오큘러스 리프트 입력 하드웨어 지원이 가능하도록 하기 위해, Unity VR 서브시스템은 세 개의 입력을 별도의 조이스틱으로 제공합니다. UnityEngine.Input 클래스를 사용하여 입력의 축과 버튼 값을 읽으십시오.
제대로 설정한 후 운영체제와 연결될 경우, 오큘러스 터치 컨트롤러는 UnityEngine.Input.GetJoystickNames()에 의해 반환되는 리스트에 Oculus Touch - Left 및 Oculus Touch - Right로 표시되고, 오큘러스 리모트는 Oculus Remote로 표시됩니다. 터치 컨트롤러 및 리모트의 올바른 설정에 대한 내용은 오큘러스 터치 컨트롤러 페어링에 대한 오큘러스 개발자 센터 문서와 오큘러스 리모트에 대한 오큘러스 지원 센터 안내문을 참조하십시오.
Unity 스크립트 코드에서 조이스틱 이름 리스트에 터치 컨트롤러의 이름이 있는지 주기적으로 확인하여 터치 컨트롤러의 유효성을 테스트할 수 있습니다. 터치 컨트롤러가 꺼져 있거나 배터리가 분리된 경우 UnityEngine.Input.GetJoystickNames()에 의해 반환되는 리스트에서 컨트롤러 이름이 빈 문자열로 대체됩니다. 터치 컨트롤러를 다시 켜면 컨트롤러 이름이 리스트에 다시 표시됩니다.
Hardware Feature | Unity Button ID | Unity Axis ID | Unity Axis Value when Pressed | Xbox Controller Analogue |
---|---|---|---|---|
Button.DpadUp | - | 6 | 1.0 | D-Pad Up |
Button.DpadDown | - | 6 | –1.0 | D-Pad Down |
Button.DpadLeft | - | 5 | –1.0 | D-Pad Left |
Button.DpadRight | - | 5 | 1.0 | D-Pad Right |
Button.One | 0 | - | - | A Button |
Button.Two | 1 | - | - | B Button |
참고: 두 터치 컨트롤러의 컨트롤은 Xbox 컨트롤러와 유사하므로 Unity의 오큘러스 터치 컨트롤러 매핑은 Xbox 컨트롤러의 컨트롤과 매우 비슷합니다.
하드웨어 기능 | 인터랙션 타입 | Unity 버튼 ID | Unity 축 ID | Unity 축 범위 | Xbox 컨트롤러 아날로그 |
---|---|---|---|---|---|
Button.One | 누름 | 0 | - | - | A 버튼 |
Button.One | 터치 | 10 | - | - | - |
Button.Two | 누름 | 1 | - | - | B 버튼 |
Button.Two | 터치 | 11 | - | - | - |
Button.Three | 누름 | 2 | - | - | X 버튼 |
Button.Three | 터치 | 12 | - | - | - |
Button.Four | 누름 | 3 | - | - | Y 버튼 |
Button.Four | 터치 | 13 | - | - | - |
Button.Start | 누름 | 7 | - | - | Start 버튼 |
Button.PrimaryThumbstick | 누름 | 8 | - | - | 왼쪽 스틱 누름 |
Button.PrimaryThumbstick | 터치 | 16 | - | - | - |
Button.PrimaryThumbstick | 근거리 터치 | - | 15 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Button.SecondaryThumbstick | 누름 | 9 | - | - | 오른쪽 스틱 누름 |
Button.SecondaryThumbstick | 터치 | 17 | - | - | - |
Button.SecondaryThumbstick | 근거리 터치 | - | 16 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Touch.PrimaryThumbRest | 터치 | 18 | - | - | - |
Touch.PrimaryThumbRest | 근거리 터치 | - | 15 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Touch.SecondaryThumbRest | 터치 | 19 | - | - | - |
Touch.SecondaryThumbRest | 근거리 터치 | - | 16 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Axis1D.PrimaryIndexTrigger | 터치 | 14 | - | - | - |
Axis1D.PrimaryIndexTrigger | 근거리 터치 | - | 13 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Axis1D.PrimaryIndexTrigger | 꾹 누름 | - | 9 | 0.0–1.0 | 왼쪽 트리거 압착 |
Axis1D.SecondaryIndexTrigger | 터치 | 15 | - | - | - |
Axis1D.SecondaryIndexTrigger | 근거리 터치 | - | 14 | 근거리 터치 감지 시 1.0, 그 외의 경우 0.0 | - |
Axis1D.SecondaryIndexTrigger | 꾹 누름 | - | 10 | 0.0–1.0 | 오른쪽 트리거 압착 |
Axis1D.PrimaryHandTrigger | 꾹 누름 | - | 11 | 0.0–1.0 | - |
Axis1D.SecondaryHandTrigger | 꾹 누름 | - | 12 | 0.0–1.0 | - |
Axis2D.PrimaryThumbstick | 수평 이동 | - | 1 | –1.0–1.0 | 왼쪽 스틱 이동 |
Axis2D.PrimaryThumbstick | 수직 이동 | - | 2 | –1.0–1.0 | 왼쪽 스틱 이동 |
Axis2D.SecondaryThumbstick | 수평 이동 | - | 4 | –1.0–1.0 | 오른쪽 스틱 이동 |
Axis2D.SecondaryThumbstick | 수직 이동 | - | 5 | –1.0–1.0 | 오른쪽 스틱 이동 |
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.