Version: 2023.2
언어: 한국어
웹 성능 고려사항
웹 애플리케이션 빌드 및 배포

웹 빌드 디버깅 및 문제 해결

Visual Studio는 Unity 웹 콘텐츠 디버깅을 지원하지 않습니다. 빌드 정보를 얻으려면 다음 팁을 사용하십시오.

브라우저의 JavaScript 콘솔

Unity 웹 플랫폼은 파일 시스템에 액세스할 수 없으므로 다른 플랫폼처럼 로그 파일을 작성하지 않습니다. 하지만 Debug.Log, Console.WriteLine 또는 Unity의 내부 로깅과 같은 모든 로깅 정보를 브라우저의 JavaScript 콘솔에 기록합니다.

JavaScript 콘솔을 열려면 다음 단계를 따르십시오.

  • Firefox에서 Windows의 경우 Ctrl-Shift-K를 누르거나 Mac의 경우 Command-Option-K를 누릅니다.
  • Chrome에서 Windows의 경우 Ctrl-Shift-J를 누르거나 Mac의 경우 Command-Option-J를 누릅니다.
  • Safari에서 Preferences > Advanced > Develop로 이동한 후 Command-Option-C를 누릅니다.
  • Microsoft Edge 또는 Internet Explorer에서 F12를 누릅니다.

개발용 빌드

For debugging purposes, you might want to make a development build in Unity (open the Build Settings window and enabled the Development Build checkbox). Development builds allow you to connect the profiler, and Unity doesn’t minify them, so the emitted JavaScript code still contains human-readable (though C++-mangled) function names. The browser uses these to display stack traces if you run into a browser error, when using Debug.LogError, or when an exception occurs and exception support is disabled. Unlike the managed stack traces that occur when you have full exception support, these stack traces have mangled names, and contain managed code and the internal Unity Engine code.

예외 지원

웹은 여러 예외 수준을 지원하지만 기본적으로 Unity 웹은 명시적으로 발생하는 예외만 지원합니다. 자세한 내용은 웹 애플리케이션 빌드를 참조하십시오. Full 예외 지원을 활성화할 수 있으며, 이 경우 관리되는 코드에서 null 참조와 범위 초과 배열 요소에 대한 액세스를 찾아내기 위해 IL2CPP 생성 코드로 추가 검사를 진행할 수 있습니다. 이러한 추가 검사 과정은 성능에 큰 영향을 주고 코드 용량과 로드 시간을 증가시키므로, 디버깅 목적으로만 사용하는 것이 좋습니다.

Full exception support also emits function names to generate stack traces for your managed code. For this reason, stack traces appear in the console for uncaught exceptions and for Debug.Log statements. Use System.Environment.Stacktrace to get a stack trace string.

문제 해결

문제: 빌드의 메모리 부족

이는 특히 32비트 브라우저에서 흔히 발생하는 문제입니다. 웹 메모리 문제와 해결 방법에 대한 자세한 내용은 Unity 웹 메모리 기술 문서를 참조하십시오.

오류 메시지: 잘못된 헤더 검사

브라우저 콘솔 로그는 보통 이러한 오류를 잘못된 서버 설정의 결과로 출력합니다.릴리스 빌드를 배포하는 방법에 대한 자세한 내용은 압축된 빌드 배포에 관한 문서를 참조하십시오.

오류 메시지:이 포맷(1)의 압축 해제가 이 플랫폼에서 지원되지 않음

콘텐츠가 Unity 웹에서 지원하지 않는 LZMA 압축 방식으로 압축된 에셋 번들을 로드하려고 시도하면 브라우저 콘솔 로그가 이러한 오류를 출력합니다. LZ4 압축 방식으로 에셋 번들을 다시 압축하면 이 문제를 해결할 수 있습니다. 웹의 압축에 관한 자세한 내용은 웹 빌드 문서의 에셋 번들 섹션을 참조하십시오.

웹 성능 고려사항
웹 애플리케이션 빌드 및 배포