Skip to content

1.x #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed

1.x #72

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<p align="center">
<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>
<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>
<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>
</p>

## ⚙ 安装
Expand Down Expand Up @@ -131,4 +132,4 @@

- **谢谢您选择我们的扩展包。**
- **如果此软件包对您有所帮助。**
- **请考虑通过添加⭐来表示支持。**
- **请考虑通过添加⭐来表示支持。**
13 changes: 13 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: workflow for Codecov
on: [push]
jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
2 changes: 1 addition & 1 deletion Editor/Interface/AssetInfoData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public string Type
private long _size;

[NonSerialized]
private string _type;
internal string _type;

[NonSerialized]
private string _guid;
Expand Down
181 changes: 90 additions & 91 deletions Editor/Windows/Page/2AssetPage.EditConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ internal class AssetPageEditConfig : IAssetPage
public AssetPageEditConfig()
{
GC_Select = GEContent.NewSetting("ic_Eyes", "选择资源配置文件");
GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
Data = AssetCollectRoot.GetOrCreate();
Config = ASConfig.GetOrCreate();
GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
Data = AssetCollectRoot.GetOrCreate();
Config = ASConfig.GetOrCreate();


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

public void Dispose()
{
Data = null;
Config = null;
GC_SAVE = null;
Data = null;
Config = null;
GC_SAVE = null;
GC_Select = null;
}

Expand Down Expand Up @@ -299,116 +299,115 @@ private void OnDrawASConfig(Rect rect)
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - cell.x;
GUI.Label(cell,
GUI.Label(cell, string.Format("运行时 : {0}/{1}",
#if UNITY_ANDROID
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
"Application.persistentDataPath"
#elif UNITY_STANDALONE_WIN
$"运行时 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}"
"Application.streamingAssetsPath"
#elif UNITY_IPHONE || UNITY_IOS
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
"Application.persistentDataPath"
#elif UNITY_WEBGL
$"运行时 : Application.persistentDataPath/{Config.RuntimeRootDirectory}"
"Application.persistentDataPath"
#else
"Not Support"
#endif
, GEStyle.HeaderLabel);
, Config.RuntimeRootDirectory), GEStyle.HeaderLabel);
}

if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = false;

switch (Config.ASMode)
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.RuntimeRootDirectory)))
{
case EASMode.Remote:
switch (Config.ASMode)
{
case EASMode.Remote:
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
}
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
{
cell.width = 100;
cell.x = rect.width - cell.width;
if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
{
AssetWindow.OpenPage<AssetPageLook.FirstPackage>();
GUI.FocusControl(null);
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "远端资源地址", GEStyle.HeaderLabel);
}
using (new EditorGUI.DisabledGroupScope(string.IsNullOrEmpty(Config.URL)))
{
cell.width = 100;
cell.x = rect.width - cell.width;
if (GUI.Button(cell, "跳转首包清单", GEStyle.toolbarbutton))
{
AssetWindow.OpenPage<AssetPageLook.FirstPackage>();
GUI.FocusControl(null);
}

cell.width = 100;
cell.x -= cell.width;
if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
{
Application.OpenURL(Config.URL);
GUI.FocusControl(null);
}
}

cell.width = 100;
cell.x -= cell.width;
if (GUI.Button(cell, "打开远端网页", GEStyle.toolbarbutton))
{
Application.OpenURL(Config.URL);
GUI.FocusControl(null);
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - cell.x;
cell.height = 50;
Config.URL = GUI.TextArea(cell, Config.URL);
}
}

{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - cell.x;
cell.height = 50;
Config.URL = GUI.TextArea(cell, Config.URL);
}
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
cell.height = 20;
GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
}

{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
cell.height = 20;
GUI.Label(cell, "下载失败尝试次数", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.DownloadFailedTryAgain = EditorGUI.IntSlider(cell, Config.DownloadFailedTryAgain, 3, 36);
}
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
}

{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "资源加载的最大数量", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.LoadingMaxTimeSlice = EditorGUI.IntSlider(cell, Config.LoadingMaxTimeSlice, 144, 8192);
}
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
}

{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "请求超时时间", GEStyle.HeaderLabel);
cell.x += cell.width;
cell.width = rect.width - cell.x;
Config.Timeout = EditorGUI.IntSlider(cell, Config.Timeout, 3, 180);
break;
}

if (string.IsNullOrEmpty(Config.URL)) GUI.enabled = true;
break;
}
default:
using (new EditorGUI.DisabledGroupScope(false))
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = 150;
GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
foreach (var config in Config.Packages)
default:
using (new EditorGUI.DisabledGroupScope(true))
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - 20 - cell.x;
GUI.Label(cell, config.Name, GEStyle.HeaderLabel);

cell.x += cell.width;
cell.width = 20;
config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
cell.width = 150;
GUI.Label(cell, "资源包配置", GEStyle.HeaderLabel);
foreach (var config in Config.Packages)
{
cell.y += cell.height;
cell.x = rect.x + 10;
cell.width = rect.width - 20 - cell.x;
GUI.Label(cell, config.Name, GEStyle.HeaderLabel);

cell.x += cell.width;
cell.width = 20;
config.IsDefault = GUI.Toggle(cell, config.IsDefault, "");
}
}
}

break;
break;
}
}

if (string.IsNullOrEmpty(Config.RuntimeRootDirectory)) GUI.enabled = true;
}
}
}
18 changes: 6 additions & 12 deletions Editor/Windows/Page/4AssetPage.LookCollect.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Unity.Collections;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEditor;
using UnityEngine;

Expand Down Expand Up @@ -163,18 +166,8 @@ DisplayPackages is null ||
}

rect.x += rect.width + 3;
rect.width = width - 30 - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
TreeViewQueryAsset.searchString = DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)].Count > 300
? EditorGUI.DelayedTextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField)
: EditorGUI.TextField(rect, TreeViewQueryAsset.searchString, GEStyle.SearchTextField);

rect.x += rect.width;
rect.width = 30;
if (GUI.Button(rect, Instance.GC_CLEAR, GEStyle.TEtoolbarbutton))
{
GUI.FocusControl(null);
TreeViewQueryAsset.searchString = string.Empty;
}
rect.width = width - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190);
SearchAssetText(rect);

rect.x += rect.width;
rect.width = 190;
Expand Down Expand Up @@ -270,6 +263,7 @@ private bool FilterData(AssetDataInfo data)

public void UpdateData()
{
TreeViewQueryAsset.searchString = string.Empty;
GUI.FocusControl(null);
if (!Data.IsValidCollect()) return;

Expand Down
Loading
Loading