Skip to content

Commit

Permalink
Merge pull request #12 from UniToolsTeam/0.0.6
Browse files Browse the repository at this point in the history
Fixed editor webGL errors
  • Loading branch information
Rinal authored May 18, 2022
2 parents cf06318 + a3438a8 commit 02f8aa6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Editor/Platforms/Standalone/Build/BuildMacOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ public sealed class BuildMacOS : ScriptableBuildStepWithOptions
{
#if UNITY_EDITOR_OSX
[SerializeField] private MacOSArchitecture m_architecture = default;
#endif
[SerializeField] private bool m_createXcodeProject = false;

#endif
public override BuildTarget Target => BuildTarget.StandaloneOSX;

public override async Task<BuildReport> Execute()
Expand Down
13 changes: 10 additions & 3 deletions Editor/Platforms/WebGL/BuildWebGL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.WebGL;
using UnityEngine;
#if UNITY_WEBGL
using UnityEditor.WebGL;
#endif

namespace UniTools.Build
{
Expand All @@ -13,7 +15,9 @@ namespace UniTools.Build
)]
public sealed class BuildWebGL : ScriptableBuildStepWithOptions
{
#if UNITY_WEBGL
[SerializeField] private CodeOptimization m_codeOptimization = CodeOptimization.Size;
#endif
[SerializeField] private Il2CppCodeGeneration m_IL2CPPCodeGeneration = Il2CppCodeGeneration.OptimizeSize;
[SerializeField] private WebGLExceptionSupport m_exceptionSupport = WebGLExceptionSupport.None;
[SerializeField] private WebGLCompressionFormat m_compressionFormat = default;
Expand All @@ -35,8 +39,11 @@ public override async Task<BuildReport> Execute()
PlayerSettings.WebGL.dataCaching = m_dataCaching;
PlayerSettings.WebGL.debugSymbolMode = m_debugSymbolMode;
PlayerSettings.WebGL.decompressionFallback = m_decompressionFallback;

EditorUserBuildSettings.SetPlatformSettings(UnityEditor.BuildPipeline.GetBuildTargetName(BuildTarget.WebGL), "CodeOptimization", m_codeOptimization.ToString()); // or "size"
#if UNITY_WEBGL
EditorUserBuildSettings.SetPlatformSettings(UnityEditor.BuildPipeline.GetBuildTargetName(BuildTarget.WebGL), "CodeOptimization", m_codeOptimization.ToString());
#else
EditorUserBuildSettings.SetPlatformSettings(UnityEditor.BuildPipeline.GetBuildTargetName(BuildTarget.WebGL), "CodeOptimization", "Size");
#endif
EditorUserBuildSettings.il2CppCodeGeneration = m_IL2CPPCodeGeneration;

AssetDatabase.Refresh();
Expand Down

0 comments on commit 02f8aa6

Please sign in to comment.