게임패드와 조이스틱은 HTML5 게임패드 API를 지원하는 브라우저에서 (Input> 클래스를 사용해) WebGL에서 지원됩니다. 해당 브라우저는 브라우저 호환성 테이블에서 확인할 수 있습니다.
콘텐츠에 포커스가 있는 동안 사용자가 기기와 상호작용한 후에만 브라우저에서 사용 가능 입력 장치 액세스를 허용할 수 있습니다. 이 기능은 브라우저 핑거프린팅 목적으로 연결된 기기 사용을 방지하는 보안 조치입니다. 그렇기 때문에 연결된 기기에 대해 Input.GetJoystickNames() 를 확인하기 전에 기기에서 버튼을 클릭하도록 해야 합니다.
Unity WebGL은 아직 모바일 디바이스를 공식적으로 지원하지 않지만, Input.touches 및 관련 API는 터치를 지원하는 브라우저 및 기기에서 구현됩니다. Input.acceleration 도 마찬가지입니다.
기본적으로 Unity WebGL은 WebGL 캔버스에 포커스가 있는지 여부와 관계없이 페이지에 전송되는 키보드 입력을 모두 처리합니다. 그렇기 때문에 사용자는 캔버스를 클릭하여 캔버스에 포커스를 맞출 필요 없이 키보드 기반 게임을 바로 플레이하기 시작할 수 있습니다. 하지만 페이지에 키보드 입력을 수신해야 하는 다른 HTML 요소(텍스트 필드 등)가 있는 경우 문제가 발생할 수 있습니다. Unity는 입력 이벤트를 나머지 페이지에서 받기 전에 소비하기 때문입니다. 다른 HTML 요소에서 키보드 입력을 수신하도록 해야 하는 경우 WebGLInput.captureAllKeyboardInput 프로퍼티를 사용하여 이 동작을 변경할 수 있습니다.
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.