BuildWebGLForCi

This commit is contained in:
ousttrue 2025-01-24 23:38:37 +09:00
parent 8108583f3e
commit fe511a5211
3 changed files with 28 additions and 4 deletions

View File

@ -1,4 +1,5 @@
using UnityEditor;
using UnityEngine.Rendering;
namespace VRM
{
@ -15,7 +16,7 @@ namespace VRM
var report = BuildPipeline.BuildPlayer(
scenes,
"./Build/DummyBuild.exe",
"./Build/DummyBuild/DummyBuild.exe",
BuildTarget.StandaloneWindows,
BuildOptions.Development
);
@ -25,5 +26,25 @@ namespace VRM
throw new System.Exception(report.summary.ToString());
}
}
public static void BuildWebGL_SimpleViewer()
{
var scenes = new string[]{
"./Assets/VRM_Samples/SimpleViewer/SimpleViewer.unity",
};
var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
{
scenes = scenes,
locationPathName = "Build/SimpleViewer",
target = BuildTarget.WebGL,
}
);
if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
{
throw new System.Exception(report.summary.ToString());
}
}
}
}

View File

@ -55,7 +55,10 @@ namespace VRM
[MenuItem(DevelopmentMenuPrefix + "/Build dummy for CI", false, 93)]
private static void BuildDummyForCi() => BuildClass.Build();
[MenuItem(DevelopmentMenuPrefix + "/Create UnityPackage", false, 94)]
[MenuItem(DevelopmentMenuPrefix + "/Build WebGL for CI", false, 94)]
private static void BuildWebGLForCi() => BuildClass.BuildWebGL_SimpleViewer();
[MenuItem(DevelopmentMenuPrefix + "/Create UnityPackage", false, 95)]
private static void CreateUnityPackage() => VRMExportUnityPackage.CreateUnityPackageWithoutBuild();
#endif
}

View File

@ -602,7 +602,7 @@ PlayerSettings:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 1
webGLCompressionFormat: 2
webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1
webGLThreadsSupport: 0
@ -628,7 +628,7 @@ PlayerSettings:
Stadia: UNITY_POST_PROCESSING_STACK_V2
Standalone: VRM_DEVELOP;UNITY_POST_PROCESSING_STACK_V2
VisionOS: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2
WebGL: UNITY_POST_PROCESSING_STACK_V2;VRM_DEVELOP
Windows Store Apps: UNITY_POST_PROCESSING_STACK_V2
XboxOne: UNITY_POST_PROCESSING_STACK_V2
tvOS: UNITY_POST_PROCESSING_STACK_V2