@@ -30,6 +30,7 @@ public class SettingsDialog : EditorWindow {
30
30
/// </summary>
31
31
private class Settings {
32
32
internal bool enableAutoResolution ;
33
+ internal bool autoResolveOnBuild ;
33
34
internal bool useGradleDaemon ;
34
35
internal bool installAndroidPackages ;
35
36
internal string packageDir ;
@@ -45,6 +46,7 @@ private class Settings {
45
46
/// </summary>
46
47
internal Settings ( ) {
47
48
enableAutoResolution = SettingsDialog . EnableAutoResolution ;
49
+ autoResolveOnBuild = SettingsDialog . AutoResolveOnBuild ;
48
50
useGradleDaemon = SettingsDialog . UseGradleDaemon ;
49
51
installAndroidPackages = SettingsDialog . InstallAndroidPackages ;
50
52
packageDir = SettingsDialog . PackageDir ;
@@ -62,6 +64,7 @@ internal Settings() {
62
64
internal void Save ( ) {
63
65
SettingsDialog . UseGradleDaemon = useGradleDaemon ;
64
66
SettingsDialog . EnableAutoResolution = enableAutoResolution ;
67
+ SettingsDialog . AutoResolveOnBuild = autoResolveOnBuild ;
65
68
SettingsDialog . InstallAndroidPackages = installAndroidPackages ;
66
69
if ( SettingsDialog . ConfigurablePackageDir ) SettingsDialog . PackageDir = packageDir ;
67
70
SettingsDialog . ExplodeAars = explodeAars ;
@@ -75,6 +78,7 @@ internal void Save() {
75
78
76
79
const string Namespace = "GooglePlayServices." ;
77
80
private const string AutoResolveKey = Namespace + "AutoResolverEnabled" ;
81
+ private const string AutoResolveOnBuildKey = Namespace + "AutoResolveOnBuild" ;
78
82
private const string PackageInstallKey = Namespace + "AndroidPackageInstallationEnabled" ;
79
83
private const string PackageDirKey = Namespace + "PackageDirectory" ;
80
84
private const string ExplodeAarsKey = Namespace + "ExplodeAars" ;
@@ -89,6 +93,7 @@ internal void Save() {
89
93
// List of preference keys, used to restore default settings.
90
94
private static string [ ] PreferenceKeys = new [ ] {
91
95
AutoResolveKey ,
96
+ AutoResolveOnBuildKey ,
92
97
PackageInstallKey ,
93
98
PackageDirKey ,
94
99
ExplodeAarsKey ,
@@ -133,6 +138,13 @@ internal static bool EnableAutoResolution {
133
138
get { return projectSettings . GetBool ( AutoResolveKey , true ) ; }
134
139
}
135
140
141
+ internal static bool AutoResolveOnBuild {
142
+ set {
143
+ projectSettings . SetBool ( AutoResolveOnBuildKey , value ) ;
144
+ }
145
+ get { return projectSettings . GetBool ( AutoResolveOnBuildKey , true ) ; }
146
+ }
147
+
136
148
internal static bool UseGradleDaemon {
137
149
private set { projectSettings . SetBool ( UseGradleDaemonKey , value ) ; }
138
150
get { return projectSettings . GetBool ( UseGradleDaemonKey , false ) ; }
@@ -179,7 +191,7 @@ internal static bool UseProjectSettings {
179
191
// Whether AARs that use variable expansion should be exploded when Gradle builds are
180
192
// enabled.
181
193
internal static bool ExplodeAars {
182
- private set { projectSettings . SetBool ( ExplodeAarsKey , value ) ; }
194
+ set { projectSettings . SetBool ( ExplodeAarsKey , value ) ; }
183
195
get { return projectSettings . GetBool ( ExplodeAarsKey , true ) ; }
184
196
}
185
197
@@ -231,7 +243,7 @@ internal static string ValidatePackageDir(string directory) {
231
243
}
232
244
233
245
public void Initialize ( ) {
234
- minSize = new Vector2 ( 350 , 425 ) ;
246
+ minSize = new Vector2 ( 425 , 445 ) ;
235
247
position = new Rect ( UnityEngine . Screen . width / 3 , UnityEngine . Screen . height / 3 ,
236
248
minSize . x , minSize . y ) ;
237
249
}
@@ -265,6 +277,19 @@ public void OnGUI() {
265
277
GUILayout . Label ( "Enable Auto-Resolution" , EditorStyles . boldLabel ) ;
266
278
settings . enableAutoResolution = EditorGUILayout . Toggle ( settings . enableAutoResolution ) ;
267
279
GUILayout . EndHorizontal ( ) ;
280
+ GUILayout . Label (
281
+ settings . enableAutoResolution ?
282
+ ( "Android libraries will be downloaded and processed in the editor." ) :
283
+ ( "Android libraries will *not* be downloaded or processed in the editor." ) ) ;
284
+
285
+ GUILayout . BeginHorizontal ( ) ;
286
+ GUILayout . Label ( "Enable Resolution On Build" , EditorStyles . boldLabel ) ;
287
+ settings . autoResolveOnBuild = EditorGUILayout . Toggle ( settings . autoResolveOnBuild ) ;
288
+ GUILayout . EndHorizontal ( ) ;
289
+ GUILayout . Label (
290
+ settings . autoResolveOnBuild ?
291
+ ( "Android libraries will be downloaded and processed in a pre-build step." ) :
292
+ ( "Android libraries will *not* be downloaded or processed in a pre-build step." ) ) ;
268
293
269
294
GUILayout . BeginHorizontal ( ) ;
270
295
GUILayout . Label ( "Install Android Packages" , EditorStyles . boldLabel ) ;
@@ -308,7 +333,8 @@ public void OnGUI() {
308
333
309
334
// Disable the ability to toggle the auto-resolution disabled warning
310
335
// when auto resolution is enabled.
311
- EditorGUI . BeginDisabledGroup ( settings . enableAutoResolution ) ;
336
+ EditorGUI . BeginDisabledGroup ( settings . enableAutoResolution ||
337
+ settings . autoResolveOnBuild ) ;
312
338
GUILayout . BeginHorizontal ( ) ;
313
339
GUILayout . Label ( "Auto-Resolution Disabled Warning" , EditorStyles . boldLabel ) ;
314
340
settings . autoResolutionDisabledWarning =
0 commit comments