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)
|
||||
|
||||
Reference in New Issue
Block a user