File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,8 @@ public sealed class BuildMacOS : ScriptableBuildStepWithOptions
1616 {
1717#if UNITY_EDITOR_OSX
1818 [ SerializeField ] private MacOSArchitecture m_architecture = default ;
19- #endif
2019 [ SerializeField ] private bool m_createXcodeProject = false ;
21-
20+ #endif
2221 public override BuildTarget Target => BuildTarget . StandaloneOSX ;
2322
2423 public override async Task < BuildReport > Execute ( )
Original file line number Diff line number Diff line change 22using UnityEditor ;
33using UnityEditor . Build ;
44using UnityEditor . Build . Reporting ;
5- using UnityEditor . WebGL ;
65using UnityEngine ;
6+ #if UNITY_WEBGL
7+ using UnityEditor . WebGL ;
8+ #endif
79
810namespace UniTools . Build
911{
@@ -13,7 +15,9 @@ namespace UniTools.Build
1315 ) ]
1416 public sealed class BuildWebGL : ScriptableBuildStepWithOptions
1517 {
18+ #if UNITY_WEBGL
1619 [ SerializeField ] private CodeOptimization m_codeOptimization = CodeOptimization . Size ;
20+ #endif
1721 [ SerializeField ] private Il2CppCodeGeneration m_IL2CPPCodeGeneration = Il2CppCodeGeneration . OptimizeSize ;
1822 [ SerializeField ] private WebGLExceptionSupport m_exceptionSupport = WebGLExceptionSupport . None ;
1923 [ SerializeField ] private WebGLCompressionFormat m_compressionFormat = default ;
@@ -35,8 +39,11 @@ public override async Task<BuildReport> Execute()
3539 PlayerSettings . WebGL . dataCaching = m_dataCaching ;
3640 PlayerSettings . WebGL . debugSymbolMode = m_debugSymbolMode ;
3741 PlayerSettings . WebGL . decompressionFallback = m_decompressionFallback ;
38-
39- EditorUserBuildSettings . SetPlatformSettings ( UnityEditor . BuildPipeline . GetBuildTargetName ( BuildTarget . WebGL ) , "CodeOptimization" , m_codeOptimization . ToString ( ) ) ; // or "size"
42+ #if UNITY_WEBGL
43+ EditorUserBuildSettings . SetPlatformSettings ( UnityEditor . BuildPipeline . GetBuildTargetName ( BuildTarget . WebGL ) , "CodeOptimization" , m_codeOptimization . ToString ( ) ) ;
44+ #else
45+ EditorUserBuildSettings . SetPlatformSettings ( UnityEditor . BuildPipeline . GetBuildTargetName ( BuildTarget . WebGL ) , "CodeOptimization" , "Size" ) ;
46+ #endif
4047 EditorUserBuildSettings . il2CppCodeGeneration = m_IL2CPPCodeGeneration ;
4148
4249 AssetDatabase . Refresh ( ) ;
You can’t perform that action at this time.
0 commit comments