@@ -33,89 +33,57 @@ public class BuildScriptMenu
33
33
[ MenuItem ( "Tools/Build WebGL/webgl1" ) ]
34
34
public static void BuildWebGL1 ( )
35
35
{
36
- var parameters = new List < string > ( baseParameters ) ;
37
- string tag = $ "{ Application . unityVersion } -webgl1-manualBuild";
38
- SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
39
- SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
40
- SetParameterValue ( "-tag" , tag , ref parameters ) ;
41
- SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
42
- SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
43
- BuildWithParameters ( parameters ) ;
36
+ BuildWebGL ( $ "{ Application . unityVersion } -webgl1-manualBuild") ;
44
37
}
45
38
46
39
[ MenuItem ( "Tools/Build WebGL/minsize-webgl1" ) ]
47
40
public static void BuildWebGL1MinSize ( )
48
41
{
49
- var parameters = new List < string > ( baseParameters ) ;
50
- string tag = $ "{ Application . unityVersion } -minsize-webgl1-manualBuild";
51
- SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
52
- SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
53
- SetParameterValue ( "-tag" , tag , ref parameters ) ;
54
- SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
55
- SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
56
- BuildWithParameters ( parameters ) ;
42
+ BuildWebGL ( $ "{ Application . unityVersion } -minsize-webgl1-manualBuild") ;
57
43
}
58
44
#endif
59
45
60
46
[ MenuItem ( "Tools/Build WebGL/webgl2" ) ]
61
47
public static void BuildWebGL2 ( )
62
48
{
63
- var parameters = new List < string > ( baseParameters ) ;
64
- string tag = $ "{ Application . unityVersion } -webgl2-manualBuild";
65
- SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
66
- SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
67
- SetParameterValue ( "-tag" , tag , ref parameters ) ;
68
- SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
69
- SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
70
- BuildWithParameters ( parameters ) ;
49
+ BuildWebGL ( $ "{ Application . unityVersion } -webgl2-manualBuild") ;
71
50
}
72
51
73
52
[ MenuItem ( "Tools/Build WebGL/minsize-webgl2" ) ]
74
53
public static void BuildWebGL2MinSize ( )
75
54
{
76
- var parameters = new List < string > ( baseParameters ) ;
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 ) ;
55
+ BuildWebGL ( $ "{ Application . unityVersion } -minsize-webgl2-manualBuild") ;
56
+ }
57
+
58
+ [ MenuItem ( "Tools/Build WebGL/minsize-stripped-webgl2" ) ]
59
+ public static void BuildWebGL2MinSizeStripped ( )
60
+ {
61
+ BuildWebGL ( $ "{ Application . unityVersion } -minsize-stripped-webgl2-manualBuild") ;
84
62
}
85
63
86
64
#if UNITY_2023_2_OR_NEWER
87
65
[ MenuItem ( "Tools/Build WebGL/webgpu" ) ]
88
66
public static void BuildWebGpu ( )
89
67
{
90
- var parameters = new List < string > ( baseParameters ) ;
91
- string tag = $ "{ Application . unityVersion } -webgpu-manualBuild";
92
- SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
93
- SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
94
- SetParameterValue ( "-tag" , tag , ref parameters ) ;
95
- SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
96
- SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
97
- BuildWithParameters ( parameters ) ;
68
+ BuildWebGL ( $ "{ Application . unityVersion } -webgpu-manualBuild") ;
98
69
}
99
70
100
71
[ MenuItem ( "Tools/Build WebGL/minsize-webgpu" ) ]
101
72
public static void BuildWebGpuMinSize ( )
102
73
{
103
- var parameters = new List < string > ( baseParameters ) ;
104
- string tag = $ "{ Application . unityVersion } -minsize-webgpu-manualBuild";
105
- SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
106
- SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
107
- SetParameterValue ( "-tag" , tag , ref parameters ) ;
108
- SetParameterValue ( "-customBuildPath" , $ "Builds/WebGL/{ tag } ", ref parameters ) ;
109
- SetParameterValue ( "-customBuildName" , tag , ref parameters ) ;
110
- BuildWithParameters ( parameters ) ;
74
+ BuildWebGL ( $ "{ Application . unityVersion } -minsize-webgpu-manualBuild") ;
111
75
}
112
76
#endif
113
77
114
78
[ MenuItem ( "Tools/Build WebGL/debug" ) ]
115
79
public static void BuildWebGLDebug ( )
80
+ {
81
+ BuildWebGL ( $ "{ Application . unityVersion } -debug-manualBuild") ;
82
+ }
83
+
84
+ private static void BuildWebGL ( string tag )
116
85
{
117
86
var parameters = new List < string > ( baseParameters ) ;
118
- string tag = $ "{ Application . unityVersion } -debug-manualBuild";
119
87
SetBuildTarget ( BuildTarget . WebGL , ref parameters ) ;
120
88
SetParameterValue ( "-autorunplayer" , "true" , ref parameters ) ;
121
89
SetParameterValue ( "-tag" , tag , ref parameters ) ;
0 commit comments