last web build
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -20,3 +20,12 @@ dotnet build BumpCombat.slnx --no-restore
|
||||
```
|
||||
|
||||
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을 실행하지 않는다. 웹 전용 저장·오디오·입력 호환성 검증은 별도다.
|
||||
Reference in New Issue
Block a user