Skip to content

Commit a484ab4

Browse files
authored
Merge pull request #73 from AIO-GAME/1.x
1.x
2 parents 13c0c08 + 013f8d6 commit a484ab4

9 files changed

+188
-152
lines changed

.github/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<p align="center">
1515
<a href="https://github.com/AIO-GAME/Unity.Asset.CLI/tags"> <img alt="" src="https://img.shields.io/github/package-json/version/AIO-GAME/Unity.Asset.CLI"> </a>
1616
<a href="https://openupm.com/packages/com.aio.cli.asset/"> <img alt="" src="https://img.shields.io/npm/v/com.aio.cli.asset?label=openupm&amp;registry_uri=https://package.openupm.com" /> </a>
17+
<a href="https://codecov.io/gh/AIO-GAME/Unity.Asset.CLI/"> <img alt="" src="https://codecov.io/gh/AIO-GAME/Unity.Asset.CLI/graph/badge.svg?token=8E1OBV48KP" /> </a>
1718
</p>
1819

1920
## ⚙ 安装
@@ -134,4 +135,4 @@
134135

135136
- **谢谢您选择我们的扩展包。**
136137
- **如果此软件包对您有所帮助。**
137-
- **请考虑通过添加⭐来表示支持。**
138+
- **请考虑通过添加⭐来表示支持。**

.github/workflows/codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: workflow for Codecov
2+
on: [push]
3+
jobs:
4+
run:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- uses: actions/checkout@main
9+
- uses: codecov/codecov-action@v4
10+
with:
11+
fail_ci_if_error: true # optional (default = false)
12+
token: ${{ secrets.CODECOV_TOKEN }} # required
13+
verbose: true # optional (default = false)

Editor/Interface/AssetInfoData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public string Type
282282
private long _size;
283283

284284
[NonSerialized]
285-
private string _type;
285+
internal string _type;
286286

287287
[NonSerialized]
288288
private string _guid;

Editor/Windows/Page/2AssetPage.EditConfig.cs

Lines changed: 90 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ internal class AssetPageEditConfig : IAssetPage
1818
public AssetPageEditConfig()
1919
{
2020
GC_Select = GEContent.NewSetting("ic_Eyes", "选择资源配置文件");
21-
GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
22-
Data = AssetCollectRoot.GetOrCreate();
23-
Config = ASConfig.GetOrCreate();
21+
GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
22+
Data = AssetCollectRoot.GetOrCreate();
23+
Config = ASConfig.GetOrCreate();
2424

2525

2626
ViewConfig = new ViewRect(550, 1)
@@ -35,9 +35,9 @@ public AssetPageEditConfig()
3535

3636
public void Dispose()
3737
{
38-
Data = null;
39-
Config = null;
40-
GC_SAVE = null;
38+
Data = null;
39+
Config = null;
40+
GC_SAVE = null;
4141
GC_Select = null;
4242
}
4343

@@ -299,116 +299,115 @@ private void OnDrawASConfig(Rect rect)
299299
cell.y += cell.height;
300300
cell.x = rect.x + 10;
301301
cell.width = rect.width - cell.x;
302-
GUI.Label(cell,
302+
GUI.Label(cell, string.Format("运行时 : {0}/{1}",
303303
#if UNITY_ANDROID
304-
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
304+
"Application.persistentDataPath"
305305
#elif UNITY_STANDALONE_WIN
306-
$"运行时 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}"
306+
"Application.streamingAssetsPath"
307307
#elif UNITY_IPHONE || UNITY_IOS
308-
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
308+
"Application.persistentDataPath"
309309
#elif UNITY_WEBGL
310-
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
310+
"Application.persistentDataPath"
311+
#else
312+
"Not Support"
311313
#endif
312-
, GEStyle.HeaderLabel);
314+
, Config.RuntimeRootDirectory), GEStyle.HeaderLabel);
313315
}
314-
315-
if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = false;
316-
317-
switch (Config.ASMode)
316+
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.RuntimeRootDirectory)))
318317
{
319-
case EASMode.Remote:
318+
switch (Config.ASMode)
320319
{
320+
case EASMode.Remote:
321321
{
322-
cell.y += cell.height;
323-
cell.x = rect.x + 10;
324-
cell.width = 150;
325-
GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
326-
}
327-
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
328-
{
329-
cell.width = 100;
330-
cell.x = rect.width - cell.width;
331-
if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
332322
{
333-
AssetWindow.OpenPage<AssetPageLook.FirstPackage>();
334-
GUI.FocusControl(null);
323+
cell.y += cell.height;
324+
cell.x = rect.x + 10;
325+
cell.width = 150;
326+
GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
327+
}
328+
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
329+
{
330+
cell.width = 100;
331+
cell.x = rect.width - cell.width;
332+
if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
333+
{
334+
AssetWindow.OpenPage<AssetPageLook.FirstPackage>();
335+
GUI.FocusControl(null);
336+
}
337+
338+
cell.width = 100;
339+
cell.x -= cell.width;
340+
if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
341+
{
342+
Application.OpenURL(Config.URL);
343+
GUI.FocusControl(null);
344+
}
335345
}
336346

337-
cell.width = 100;
338-
cell.x -= cell.width;
339-
if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
340347
{
341-
Application.OpenURL(Config.URL);
342-
GUI.FocusControl(null);
348+
cell.y += cell.height;
349+
cell.x = rect.x + 10;
350+
cell.width = rect.width - cell.x;
351+
cell.height = 50;
352+
Config.URL = GUI.TextArea(cell, Config.URL);
343353
}
344-
}
345354

346-
{
347-
cell.y += cell.height;
348-
cell.x = rect.x + 10;
349-
cell.width = rect.width - cell.x;
350-
cell.height = 50;
351-
Config.URL = GUI.TextArea(cell, Config.URL);
352-
}
355+
{
356+
cell.y += cell.height;
357+
cell.x = rect.x + 10;
358+
cell.width = 150;
359+
cell.height = 20;
360+
GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
361+
cell.x += cell.width;
362+
cell.width = rect.width - cell.x;
363+
Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
364+
}
353365

354-
{
355-
cell.y += cell.height;
356-
cell.x = rect.x + 10;
357-
cell.width = 150;
358-
cell.height = 20;
359-
GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
360-
cell.x += cell.width;
361-
cell.width = rect.width - cell.x;
362-
Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
363-
}
366+
{
367+
cell.y += cell.height;
368+
cell.x = rect.x + 10;
369+
cell.width = 150;
370+
GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
371+
cell.x += cell.width;
372+
cell.width = rect.width - cell.x;
373+
Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
374+
}
364375

365-
{
366-
cell.y += cell.height;
367-
cell.x = rect.x + 10;
368-
cell.width = 150;
369-
GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
370-
cell.x += cell.width;
371-
cell.width = rect.width - cell.x;
372-
Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
373-
}
376+
{
377+
cell.y += cell.height;
378+
cell.x = rect.x + 10;
379+
cell.width = 150;
380+
GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
381+
cell.x += cell.width;
382+
cell.width = rect.width - cell.x;
383+
Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
384+
}
374385

375-
{
376-
cell.y += cell.height;
377-
cell.x = rect.x + 10;
378-
cell.width = 150;
379-
GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
380-
cell.x += cell.width;
381-
cell.width = rect.width - cell.x;
382-
Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
386+
break;
383387
}
384-
385-
if (string.IsNullOrEmpty(Config.URL)) GUI.enabled = true;
386-
break;
387-
}
388-
default:
389-
using (new EditorGUI.DisabledGroupScope(false))
390-
{
391-
cell.y += cell.height;
392-
cell.x = rect.x + 10;
393-
cell.width = 150;
394-
GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
395-
foreach (var config in Config.Packages)
388+
default:
389+
using (new EditorGUI.DisabledGroupScope(true))
396390
{
397391
cell.y += cell.height;
398392
cell.x = rect.x + 10;
399-
cell.width = rect.width - 20 - cell.x;
400-
GUI.Label(cell, config.Name, GEStyle.HeaderLabel);
401-
402-
cell.x += cell.width;
403-
cell.width = 20;
404-
config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
393+
cell.width = 150;
394+
GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
395+
foreach (var config in Config.Packages)
396+
{
397+
cell.y += cell.height;
398+
cell.x = rect.x + 10;
399+
cell.width = rect.width - 20 - cell.x;
400+
GUI.Label(cell, config.Name, GEStyle.HeaderLabel);
401+
402+
cell.x += cell.width;
403+
cell.width = 20;
404+
config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
405+
}
405406
}
406-
}
407407

408-
break;
408+
break;
409+
}
409410
}
410-
411-
if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = true;
412411
}
413412
}
414413
}

Editor/Windows/Page/4AssetPage.LookCollect.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using Unity.Collections;
5+
using Unity.Jobs;
6+
using Unity.Jobs.LowLevel.Unsafe;
47
using UnityEditor;
58
using UnityEngine;
69

@@ -163,18 +166,8 @@ DisplayPackages is null ||
163166
}
164167

165168
rect.x += rect.width + 3;
166-
rect.width = width - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
167-
TreeViewQueryAsset.searchString = DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)].Count > 300
168-
? EditorGUI.DelayedTextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField)
169-
: EditorGUI.TextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField);
170-
171-
rect.x += rect.width;
172-
rect.width = 30;
173-
if (GUI.Button(rect, Instance.GC_CLEAR, GEStyle.TEtoolbarbutton))
174-
{
175-
GUI.FocusControl(null);
176-
TreeViewQueryAsset.searchString = string.Empty;
177-
}
169+
rect.width = width - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
170+
SearchAssetText(rect);
178171

179172
rect.x += rect.width;
180173
rect.width = 190;
@@ -270,6 +263,7 @@ private bool FilterData(AssetDataInfo data)
270263

271264
public void UpdateData()
272265
{
266+
TreeViewQueryAsset.searchString = string.Empty;
273267
GUI.FocusControl(null);
274268
if (!Data.IsValidCollect()) return;
275269

0 commit comments

Comments
 (0)