이 섹션에서는 WebGL 옵션을 사용하여 프로젝트를 빌드하는 데 필요한 플랫폼 지원 및 기타 유용한 기술 정보에 대한 개요를 제공합니다.
Unity는 emscripten 컴파일러 툴체인을 사용하여 Unity 런타임 코드(C 및 C++로 작성)를 WebAssembly(또는 Wasm으로도 불림)로 크로스 컴파일할 수 있습니다. WebAssembly는 크기는 줄이고 로드 시간과 메모리 효율을 향상하고 네이티브 속도에 가깝게 실행할 수 있도록 설계되었습니다. Unity의 WebAssembly에 대한 자세한 내용은 이 블로그 포스트를 참조하십시오.
.NET 게임 코드(C# 스크립트)를 WebAssembly로 변환하기 위해 IL2CPP라는 기술을 사용합니다. IL2CPP는 .NET 바이트코드를 해당 C++ 소스 파일로 변환하고, 이 파일은 스크립트를 Wasm으로 변환하기 위해 emscripten을 사용하여 컴파일됩니다.
Unity WebGL 콘텐츠는 대부분의 주요 데스크톱 브라우저의 최신 버전에서 지원되지만, 각 브라우저에서 제공하는 지원 수준의 차이가 있습니다. Unity WebGL은 현재 모바일 디바이스를 지원하지 않습니다.
주로 플랫폼의 한계 때문에 Unity의 일부 기능은 WebGL 빌드에 사용할 수 없습니다. 구체적으로 설명하면 다음과 같습니다.
스레드는 지원되지 않습니다. JavaScript에서 스레딩이 지원되지 않기 때문입니다. Unity에서 성능을 높이기 위해 스레드를 내부적으로 사용하는 경우와 스크립트 코드 및 관리 dll에서 스레드를 사용하는 경우 모두 스레딩이 지원되지 않습니다. 기본적으로 System.Threading
네임스페이스 안에 있는 것은 모두 지원되지 않습니다.
WebGL 빌드는 Visual Studio에서 디버그할 수 없습니다. WebGL 빌드 디버깅 및 문제 해결을 참조하십시오.
보안 문제로 인해, 브라우저에서는 네트워킹을 위한 IP 소켓의 직접 액세스를 허용하지 않습니다. WebGL 네트워킹을 참조하십시오.
WebGL 그래픽스 API는 몇 가지 제한이 있는 OpenGL ES 2.0 및 3.0과 동일합니다. WebGL 그래픽스을 참조하십시오.
WebGL 빌드에서는 Web Audio API 기반 커스텀 백엔드를 오디오에 사용합니다. 기본 오디오 기능만 지원됩니다. WebGL에서 오디오 사용을 참조하십시오.
WebGL은 AOT 플랫폼이므로 System.Reflection.Emit
를 사용하여 코드를 동적으로 생성할 수 없습니다. 다른 모든 IL2CPP 플랫폼, iOS, 그리고 대부분의 콘솔도 마찬가지입니다.
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.