@@ -14,9 +14,12 @@ public static class BuildManager {
14
14
const string butlerRelativePath = @"Plugins/Editor/BuildManager/BuildManager/butler/butler.exe" ;
15
15
static DateTime usedDate ;
16
16
17
+ static string buildNameString ;
18
+ static string [ ] buildsPath ;
19
+
17
20
public static void RunBuildSequnce ( BuildManagerSettings settings , BuildSequence sequence , ChangelogData changelog ) {
18
21
// Start init
19
- string buildNameString = $ "{ PlayerSettings . bundleVersion } - { changelog . updateName } ";
22
+ buildNameString = $ "{ PlayerSettings . bundleVersion } - { changelog . updateName } ";
20
23
#if GAME_TEMPLATE
21
24
TemplateGameManager . InstanceEditor . buildNameString = buildNameString ;
22
25
TemplateGameManager . InstanceEditor . productName = PlayerSettings . productName ;
@@ -26,12 +29,26 @@ public static void RunBuildSequnce(BuildManagerSettings settings, BuildSequence
26
29
27
30
Debug . Log ( "Start building all" ) ;
28
31
DateTime startTime = DateTime . Now ;
32
+
33
+ Build ( settings , sequence ) ;
34
+ PostBuild ( sequence ) ;
35
+ Compress ( sequence ) ;
36
+ ItchioPush ( sequence , changelog ) ;
37
+
38
+ Debug . Log ( $ "End building all. Elapsed time: { string . Format ( "{0:mm\\ :ss}" , DateTime . Now - startTime ) } ") ;
39
+
40
+ #if UNITY_EDITOR_WIN
41
+ ShowExplorer ( sequence . builds [ sequence . builds . Count - 1 ] . outputRoot ) ;
42
+ #endif
43
+ }
44
+
45
+ static void Build ( BuildManagerSettings settings , BuildSequence sequence ) {
29
46
BuildTarget targetBeforeStart = EditorUserBuildSettings . activeBuildTarget ;
30
47
BuildTargetGroup targetGroupBeforeStart = BuildPipeline . GetBuildTargetGroup ( targetBeforeStart ) ;
31
48
string definesBeforeStart = PlayerSettings . GetScriptingDefineSymbolsForGroup ( targetGroupBeforeStart ) ;
32
49
bool isVRSupported = PlayerSettings . virtualRealitySupported ; //TODO: PlayerSettings.virtualRealitySupported is deprecated. Replace with smth new
33
50
34
- string [ ] buildsPath = new string [ sequence . builds . Count ] ;
51
+ buildsPath = new string [ sequence . builds . Count ] ;
35
52
for ( byte i = 0 ; i < sequence . builds . Count ; ++ i ) {
36
53
BuildData data = sequence . builds [ i ] ;
37
54
@@ -57,7 +74,9 @@ public static void RunBuildSequnce(BuildManagerSettings settings, BuildSequence
57
74
EditorUserBuildSettings . SwitchActiveBuildTarget ( targetGroupBeforeStart , targetBeforeStart ) ;
58
75
PlayerSettings . SetScriptingDefineSymbolsForGroup ( targetGroupBeforeStart , definesBeforeStart ) ;
59
76
PlayerSettings . virtualRealitySupported = isVRSupported ;
77
+ }
60
78
79
+ static void PostBuild ( BuildSequence sequence ) {
61
80
for ( byte i = 0 ; i < sequence . builds . Count ; ++ i ) {
62
81
if ( ! sequence . builds [ i ] . isEnabled )
63
82
continue ;
@@ -89,7 +108,9 @@ public static void RunBuildSequnce(BuildManagerSettings settings, BuildSequence
89
108
#endif
90
109
}
91
110
}
111
+ }
92
112
113
+ static void Compress ( BuildSequence sequence ) {
93
114
for ( byte i = 0 ; i < sequence . builds . Count ; ++ i ) {
94
115
if ( ! sequence . builds [ i ] . needZip || ! sequence . builds [ i ] . isEnabled )
95
116
continue ;
@@ -104,9 +125,9 @@ public static void RunBuildSequnce(BuildManagerSettings settings, BuildSequence
104
125
else
105
126
Debug . LogWarning ( $ "[Compressing] Can't find build for { GetBuildTargetExecutable ( sequence . builds [ i ] . target ) } ") ;
106
127
}
128
+ }
107
129
108
-
109
-
130
+ static void ItchioPush ( BuildSequence sequence , ChangelogData changelog ) {
110
131
for ( byte i = 0 ; i < sequence . builds . Count ; ++ i ) {
111
132
if ( ! sequence . builds [ i ] . needItchPush || ! sequence . builds [ i ] . isEnabled )
112
133
continue ;
@@ -121,12 +142,6 @@ public static void RunBuildSequnce(BuildManagerSettings settings, BuildSequence
121
142
Debug . LogWarning ( $ "[Itch.io push] Can't find build for { GetBuildTargetExecutable ( sequence . builds [ i ] . target ) } ") ;
122
143
}
123
144
}
124
-
125
- Debug . Log ( $ "End building all. Elapsed time: { string . Format ( "{0:mm\\ :ss}" , DateTime . Now - startTime ) } ") ;
126
-
127
- #if UNITY_EDITOR_WIN
128
- ShowExplorer ( sequence . builds [ sequence . builds . Count - 1 ] . outputRoot ) ;
129
- #endif
130
145
}
131
146
132
147
#region Convert to strings
0 commit comments