@@ -25,11 +25,13 @@ public class BuildScriptMenu
2525 {
2626 "-projectPath" , "" ,
2727 "-buildVersion" , PlayerSettings . bundleVersion ,
28- "-androidVersionCode" , PlayerSettings . Android . bundleVersionCode . ToString ( CultureInfo . InvariantCulture )
28+ "-androidVersionCode" , PlayerSettings . Android . bundleVersionCode . ToString ( CultureInfo . InvariantCulture ) ,
2929 } ;
3030
31+ // Unity 2023.1+ does not support webgl1 anymore
32+ #if ! UNITY_2023_1_OR_NEWER
3133 [ MenuItem ( "Tools/Build WebGL/webgl1" ) ]
32- public static void BuildWebGLDefault ( )
34+ public static void BuildWebGL1 ( )
3335 {
3436 var parameters = new List < string > ( baseParameters ) ;
3537 string tag = $ "{ Application . unityVersion } -webgl1-manualBuild";
@@ -41,8 +43,8 @@ public static void BuildWebGLDefault()
4143 BuildWithParameters ( parameters ) ;
4244 }
4345
44- [ MenuItem ( "Tools/Build WebGL/minsize" ) ]
45- public static void BuildWebGLMinSize ( )
46+ [ MenuItem ( "Tools/Build WebGL/minsize-webgl1 " ) ]
47+ public static void BuildWebGL1MinSize ( )
4648 {
4749 var parameters = new List < string > ( baseParameters ) ;
4850 string tag = $ "{ Application . unityVersion } -minsize-webgl1-manualBuild";
@@ -53,12 +55,13 @@ public static void BuildWebGLMinSize()
5355 SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
5456 BuildWithParameters ( parameters ) ;
5557 }
58+ #endif
5659
57- [ MenuItem ( "Tools/Build WebGL/debug " ) ]
58- public static void BuildWebGLDebug ( )
60+ [ MenuItem ( "Tools/Build WebGL/webgl2 " ) ]
61+ public static void BuildWebGL2 ( )
5962 {
6063 var parameters = new List < string > ( baseParameters ) ;
61- string tag = $ "{ Application . unityVersion } -debug -manualBuild";
64+ string tag = $ "{ Application . unityVersion } -webgl2 -manualBuild";
6265 SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
6366 SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
6467 SetParameterValue ( "-tag" , tag , ref parameters ) ;
@@ -67,11 +70,24 @@ public static void BuildWebGLDebug()
6770 BuildWithParameters ( parameters ) ;
6871 }
6972
70- [ MenuItem ( "Tools/Build WebGL/webgl2" ) ]
71- public static void BuildWebGLWebGL2 ( )
73+ [ MenuItem ( "Tools/Build WebGL/minsize- webgl2" ) ]
74+ public static void BuildWebGL2MinSize ( )
7275 {
7376 var parameters = new List < string > ( baseParameters ) ;
74- string tag = $ "{ Application . unityVersion } -webgl2-manualBuild";
77+ string tag = $ "{ Application . unityVersion } -minsize-webgl2-manualBuild";
78+ SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
79+ SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
80+ SetParameterValue ( "-tag" , tag , ref parameters ) ;
81+ SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
82+ SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
83+ BuildWithParameters ( parameters ) ;
84+ }
85+
86+ [ MenuItem ( "Tools/Build WebGL/debug" ) ]
87+ public static void BuildWebGLDebug ( )
88+ {
89+ var parameters = new List < string > ( baseParameters ) ;
90+ string tag = $ "{ Application . unityVersion } -debug-manualBuild";
7591 SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
7692 SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
7793 SetParameterValue ( "-tag" , tag , ref parameters ) ;
0 commit comments