Unity WebGL은 HTML5 게임패드 API를 지원하는 브라우저에서 게임패드 및 조이스틱에 대한 Input 및 InputSystem을 지원합니다.
일부 브라우저는 애플리케이션에 포커스가 있는 동안 최종 사용자가 기기와 상호작용한 후에만 입력 기기에 대한 액세스를 허용합니다. 이는 브라우저 핑거프린팅 목적으로 최종 사용자가 연결된 기기를 사용하는 것을 방지하기 위한 보안 조치입니다. 이러한 이유로 애플리케이션은 연결된 기기를 확인하기 위해 Input.GetJoystickNames()를 호출하기 전에 사용자에게 게임패드/조이스틱의 버튼을 누르도록 지시해야 합니다.
The WebGL game controller mapping for the old input system aligns with the W3 spec, where the button mapping layout is shown as follows:
버튼 | 설명 |
---|---|
buttons[0] | 오른쪽 클러스터의 하단 버튼 = 엑스표(X) |
buttons[1] | 오른쪽 클러스터의 오른쪽 버튼 = 원형 |
buttons[2] | 오른쪽 클러스터의 왼쪽 버튼 = 사각형 |
buttons[3] | 오른쪽 클러스터의 상단 버튼 = 삼각형 |
Note: As WebGL follows the W3 spec, it might not be consistent with other platforms, and requires unique handling, especially, if you’re targeting multiple platforms simultaneously (for example, Windows and Web).
Unity WebGL doesn’t officially support mobile devices (see WebGL browser compatibility) but it does implement Input.touches and other related APIs in browsers and devices with touch support. By default, mobile devices display a soft keyboard on the touch screen for entering text into UI input fields. To disable this behavior, use the WebGLInput.mobileKeyboardSupport
property.
기본적으로 Unity WebGL은 WebGL 캔버스에 포커스가 있는지 여부에 관계없이 웹 페이지에서 수신하는 모든 키보드 입력을 처리합니다. 따라서 최종 사용자는 WebGL 캔버스를 클릭할 필요 없이 키보드 기반 애플리케이션을 사용할 수 있습니다.
중요: 페이지에 키보드 입력을 수신해야 하는 다른 HTML 요소(예: 텍스트 필드)가 있는 경우 문제가 발생할 수 있습니다. Unity는 페이지의 나머지 부분이 수신하기 전에 입력 이벤트를 소비합니다. HTML 요소가 키보드 입력을 수신하도록 만들려면 WebGLInput.captureAllKeyboardInput을 false
로 설정하십시오. 이렇게 하면 WebGL 캔버스에 포커스가 있는 경우에만 애플리케이션이 입력을 수신합니다.
Unity WebGL은 공식적으로 모바일 기기를 지원하지 않지만(WebGL 브라우저 호환성 참조), 터치 지원이 포함된 브라우저 및 모바일 기기에서 Unity WebGL은 다음 센서에 대한 지원을 제공합니다.
중요: 브라우저는 보안 컨텍스트에서만 센서 입력을 허용합니다. 즉 HTTPS를 통해 페이지를 제공해야 합니다. 유일한 예외는 개발 중에 사용할 수 있는 http://localhost
입니다.
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.