From 37c7942b7103673cafa0ab45a6445f36b38f871d Mon Sep 17 00:00:00 2001 From: Horoli Date: Wed, 16 Sep 2026 18:11:10 +0900 Subject: [PATCH] last web build --- .../Scripts/Editor/BumpCombatProjectSetup.cs | 33 +++++++++++++++++++ README.md | 11 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Assets/_Project/Scripts/Editor/BumpCombatProjectSetup.cs b/Assets/_Project/Scripts/Editor/BumpCombatProjectSetup.cs index b79e0e1..a36cf7e 100644 --- a/Assets/_Project/Scripts/Editor/BumpCombatProjectSetup.cs +++ b/Assets/_Project/Scripts/Editor/BumpCombatProjectSetup.cs @@ -352,6 +352,39 @@ namespace BumpCombat.Editor Debug.Log($"Windows development build completed: {options.locationPathName}"); } + [MenuItem("BumpCombat/Build Web Development")] + public static void BuildWebDevelopment() + { + string buildDirectory = Path.GetFullPath("Builds/Web"); + Directory.CreateDirectory(buildDirectory); + + WebGLCompressionFormat previousCompression = PlayerSettings.WebGL.compressionFormat; + try + { + PlayerSettings.WebGL.compressionFormat = WebGLCompressionFormat.Disabled; + BuildPlayerOptions options = new() + { + scenes = new[] { ScenePath }, + locationPathName = buildDirectory, + target = BuildTarget.WebGL, + options = BuildOptions.Development, + }; + + BuildReport report = BuildPipeline.BuildPlayer(options); + if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) + { + throw new System.InvalidOperationException( + $"Web build failed: {report.summary.result}"); + } + + Debug.Log($"Web development build completed: {Path.Combine(buildDirectory, "index.html")}"); + } + finally + { + PlayerSettings.WebGL.compressionFormat = previousCompression; + } + } + private static void ConfigureSpriteSheets() { foreach (SpriteSheetDefinition sheet in SpriteSheets) diff --git a/README.md b/README.md index 8485c60..3093943 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,13 @@ Unity에서 IDE 프로젝트 파일을 생성한 뒤 다음으로 컴파일을 dotnet build BumpCombat.slnx --no-restore ``` -Unity Test Runner 실행은 별도이며 컴파일 성공만으로 테스트 통과를 의미하지 않는다. \ No newline at end of file +Unity Test Runner 실행은 별도이며 컴파일 성공만으로 테스트 통과를 의미하지 않는다. +## 테스트용 Web 빌드 + +1. Unity Hub에서 6000.3.19f1의 **Web Build Support** 모듈을 설치한다. +2. Build Profiles에서 Web 플랫폼으로 전환한다. +3. **BumpCombat > Build Web Development** 메뉴를 실행한다. +4. 결과는 `Builds/Web`에 생성된다. 개발용 빌드이며 테스트 서버 구성을 단순화하기 위해 압축을 사용하지 않는다. +5. 결과 폴더 전체를 HTTP 서버로 제공한다. `index.html`을 파일로 직접 열지 않는다. + +이 메뉴는 기존 씬을 빌드하며 Configure Prototype을 실행하지 않는다. 웹 전용 저장·오디오·입력 호환성 검증은 별도다. \ No newline at end of file