유니티 VR게임 개발 - 장치 가져오기, 장치의 입력 기능에 접근하기(XR.InputDevices)

유니티 VR게임 개발 - 장치 가져오기, 장치의 입력 기능에 접근하기(XR.InputDevices)

XR.InputDevices 클래스를 사용하여 XR 시스템에 사용중인 장치 및 입력기능에 접근하기

1)XR.InputDevices 클래스를 사용하여 현재 XR 시스템에 연결된 입력 장치에 접근할수있습니다. InputDevice는 컨트롤러, 헤드셋등의 물리적 장치를 의미합니다. 

 

2)InputDevices.GetDevices를 사용하여 연결된 모든 장치를 가져오기할수있습니다.

또 InputDevices.GetDevicesWithCharacteristics를 사용하여 특정한 기능 또는 용도의 장치를 가져오기합니다. 예에서 right, controller 특성을 가진 장치를 필터랑하여 가져옵니다.

 

3)InputDevice.TryGetFeatureValue를 사용하여 장치의 버튼 입력 기능을 가져오기할수있습니다. 예에서 파라미터로 지정한 primaryButton, trigger 입력기능을 검색하고 bool, float 값을 출력합니다.

https://docs.unity3d.com/ScriptReference/XR.CommonUsages.html

 

https://docs.unity3d.com/Manual/xr_input.html

 

Unity - Manual: Unity XR Input

Unity XR Input This section of the Unity User Manual provides information about all of the Unity-supported input devices for virtual realityA system that immerses users in an artificial 3D world of realistic images and sounds, using a headset and motion tr

docs.unity3d.com

 

댓글

Designed by JB FACTORY