8
8
using UnityEngine ;
9
9
10
10
public class ZipImporter : EditorWindow {
11
- private const string Version = "1.0.1 " ;
11
+ private const string Version = "1.0.2 " ;
12
12
private const string LogPrefix = "[<color=#9fffe3>ZipArchive Importer</color>] " ;
13
13
private static readonly string ProjectUserAgent = $ "ZipArchive Importer/{ Version } Internal UnityWebRequest";
14
14
private int _pageNumber ;
@@ -63,6 +63,7 @@ private void OnGUI() {
63
63
_pageNumber = 0 ;
64
64
OnDestroy ( ) ;
65
65
}
66
+
66
67
GUI . backgroundColor = defaultBgColor ;
67
68
if ( _pageNumber == 1 )
68
69
GUI . backgroundColor = new Color32 ( 255 , 255 , 0 , 170 ) ;
@@ -76,7 +77,7 @@ private void OnGUI() {
76
77
EditorGUILayout . Separator ( ) ;
77
78
EditorGUILayout . Space ( ) ;
78
79
79
- #region Page 1 (0) - Main Menu
80
+ #region Page 1 (0) - Main Menu
80
81
81
82
if ( _pageNumber == 0 ) {
82
83
if ( ! _activelyImporting ) {
@@ -90,6 +91,7 @@ private void OnGUI() {
90
91
Debug . Log ( "Importing Package Button Press" ) ;
91
92
ImportWithGui ( ) ;
92
93
}
94
+
93
95
EditorGUILayout . Separator ( ) ;
94
96
EditorGUILayout . EndHorizontal ( ) ;
95
97
@@ -122,7 +124,7 @@ private void OnGUI() {
122
124
window.UpdateGui(file.FullName, true);
123
125
window.Show();
124
126
}
125
-
127
+
126
128
EditorGUILayout.EndHorizontal();
127
129
EditorGUILayout.Space(20);
128
130
*/
@@ -147,7 +149,7 @@ private void OnGUI() {
147
149
GUI . backgroundColor = defaultBgColor ;
148
150
return ;
149
151
}
150
-
152
+
151
153
EditorGUILayout . LabelField ( "<size=15><b>Information</b></size>" ) ;
152
154
EditorGUILayout . HelpBox ( " If \" Import\" is checked, the package will be imported\n " +
153
155
" If \" Interactive\" is checked, the unity window with the package contents will show for each package" , MessageType . Info ) ;
@@ -194,9 +196,9 @@ private void OnGUI() {
194
196
}
195
197
196
198
EditorGUILayout . EndHorizontal ( ) ;
197
-
199
+
198
200
EditorGUILayout . EndScrollView ( ) ;
199
-
201
+
200
202
EditorGUILayout . BeginHorizontal ( ) ;
201
203
GUI . backgroundColor = new Color32 ( 0 , 0 , 255 , 170 ) ;
202
204
if ( GUILayout . Button ( "Import" , style : importBtn ) ) {
@@ -208,6 +210,7 @@ private void OnGUI() {
208
210
var zipEntry = _zipArchive . Entries . Single ( entry => entry . FullName == _zipContents [ i ] ) ;
209
211
_importQueue . Enqueue ( ( ) => OpenZip ( zipEntry . FullName , flag , zipEntry ) ) ;
210
212
}
213
+
211
214
for ( var i = 0 ; i < _zipContents . Count ; i ++ ) {
212
215
var flag = _interactiveCheckBoxes [ i ] ;
213
216
if ( ! _importingCheckBoxes [ i ] || flag ) continue ;
@@ -224,29 +227,38 @@ private void OnGUI() {
224
227
225
228
DoNextImport ( ) ;
226
229
}
230
+
227
231
return ;
228
232
}
229
233
234
+ #endregion
230
235
231
- #endregion
232
-
233
- #region Page 2 (1) - About
236
+ #region Page 2 (1) - About
234
237
235
238
//if (_pageNumber == 1) return;
236
239
EditorGUILayout . LabelField ( "<size=15><b>About</b></size>" ) ;
237
240
238
241
EditorGUILayout . LabelField ( $ "<size=12><b>Version:</b> <color=#EECCE0>{ Version } </color>{ ( _updateAvailable ? $ " - <color=red>Update Available</color> - v{ _newVersionString } " : "" ) } </size>") ;
239
- EditorGUILayout . BeginHorizontal ( ) ;
240
- if ( GUILayout . Button ( "Check For Update" ) )
241
- CheckForUpdate ( ) ;
242
242
243
243
if ( _updateAvailable ) {
244
+ EditorGUILayout . BeginHorizontal ( ) ;
245
+ GUI . enabled = false ;
246
+ if ( GUILayout . Button ( "Check for Update" ) ) { }
247
+ GUI . enabled = true ;
248
+ EditorGUILayout . EndHorizontal ( ) ;
249
+ EditorGUILayout . BeginHorizontal ( ) ;
244
250
if ( GUILayout . Button ( "Open Booth Page" ) )
245
251
Application . OpenURL ( "https://mintylabs.booth.pm/items/5527952" ) ;
246
- if ( GUILayout . Button ( "Open GitHub Releases Page" ) )
252
+ if ( GUILayout . Button ( "Open Gumroad Page" ) )
253
+ Application . OpenURL ( "https://mintylabs.gumroad.com/l/ScreenshotUtility" ) ;
254
+ if ( GUILayout . Button ( "Open GitHub Page" ) )
247
255
Application . OpenURL ( "https://github.com/Minty-Labs/Unity-Tools/releases" ) ;
248
256
}
249
-
257
+ else {
258
+ EditorGUILayout . BeginHorizontal ( ) ;
259
+ if ( GUILayout . Button ( "Check for Update" ) )
260
+ CheckForUpdate ( ) ;
261
+ }
250
262
EditorGUILayout . EndHorizontal ( ) ;
251
263
252
264
EditorGUILayout . Space ( 5 ) ;
@@ -255,18 +267,43 @@ private void OnGUI() {
255
267
GUI . backgroundColor = new Color32 ( 0 , 255 , 170 , 255 ) ;
256
268
if ( GUILayout . Button ( "Minty Labs" ) )
257
269
Application . OpenURL ( "https://mintylabs.dev/" ) ;
258
- GUI . backgroundColor = new Color32 ( 252 , 77 , 80 , 255 ) ;
259
- if ( GUILayout . Button ( "Booth" ) )
260
- Application . OpenURL ( "https://mintylabs.booth.pm/" ) ;
261
- GUI . backgroundColor = new Color32 ( 29 , 155 , 240 , 255 ) ;
262
- if ( GUILayout . Button ( "X (Twitter)" ) )
263
- Application . OpenURL ( "https://x.com/MintLiIy" ) ;
270
+
264
271
GUI . backgroundColor = new Color32 ( 0 , 0 , 0 , 255 ) ;
265
272
if ( GUILayout . Button ( "GitHub" ) )
266
273
Application . OpenURL ( "https://github.com/MintLily" ) ;
274
+
275
+ GUI . backgroundColor = new Color32 ( 29 , 155 , 240 , 255 ) ;
276
+ if ( GUILayout . Button ( "X (Twitter)" ) )
277
+ Application . OpenURL ( "https://x.com/MintLiIy" ) ;
278
+
279
+ EditorGUILayout . EndHorizontal ( ) ;
280
+
281
+ EditorGUILayout . BeginHorizontal ( ) ;
282
+
283
+ GUI . backgroundColor = new Color32 ( 252 , 77 , 80 , 255 ) ;
284
+ if ( GUILayout . Button ( "Booth" ) )
285
+ Application . OpenURL ( "https://mintylabs.booth.pm/" ) ;
286
+
287
+ GUI . backgroundColor = new Color32 ( 255 , 144 , 232 , 255 ) ;
288
+ if ( GUILayout . Button ( "Gumroad" ) )
289
+ Application . OpenURL ( "https://mintylabs.gumroad.com/" ) ;
290
+
291
+ GUI . backgroundColor = new Color32 ( 12 , 14 , 29 , 255 ) ;
292
+ if ( GUILayout . Button ( "Jinxxy" ) )
293
+ Application . OpenURL ( "https://jinxxy.com/MintLily" ) ;
294
+
295
+ EditorGUILayout . EndHorizontal ( ) ;
296
+
297
+ EditorGUILayout . BeginHorizontal ( ) ;
298
+
267
299
GUI . backgroundColor = new Color32 ( 0 , 185 , 254 , 255 ) ;
268
300
if ( GUILayout . Button ( "Ko-fi (Donate)" ) )
269
301
Application . OpenURL ( "https://ko-fi.com/MintLily" ) ;
302
+
303
+ GUI . backgroundColor = new Color32 ( 241 , 101 , 82 , 255 ) ;
304
+ if ( GUILayout . Button ( "Patreon (Donate)" ) )
305
+ Application . OpenURL ( "https://www.patreon.com/MintLily" ) ;
306
+
270
307
EditorGUILayout . EndHorizontal ( ) ;
271
308
272
309
EditorGUILayout . Space ( 10 ) ;
@@ -280,7 +317,7 @@ private void OnGUI() {
280
317
EditorGUILayout . LabelField ( "Elly, Penny, Emily, Myrkur" ) ;
281
318
EditorGUILayout . EndVertical ( ) ;
282
319
283
- #endregion
320
+ #endregion
284
321
}
285
322
286
323
private static void OpenZip ( string name , bool interactive , ZipArchiveEntry archiveEntry ) {
@@ -373,6 +410,7 @@ private void Import(bool interactive) {
373
410
OpenZip ( entry . FullName , interactive , entry ) ) ;
374
411
}
375
412
}
413
+
376
414
break ;
377
415
case ".unitypackage" :
378
416
_activelyImporting = true ;
@@ -383,7 +421,7 @@ private void Import(bool interactive) {
383
421
}
384
422
}
385
423
386
- private void EventFailureMethod ( string name , string msg ) => ImportEndEvent ( name ) ;
424
+ private void EventFailureMethod ( string eventName , string msg ) => ImportEndEvent ( eventName ) ;
387
425
388
426
private void ImportEndEvent ( string nameOfPackage ) {
389
427
AssetDatabase . importPackageCompleted -= ImportEndEvent ;
0 commit comments