Skip to content

Commit fa47df8

Browse files
authored
Merge pull request #44 from AIO-GAME/1.x
1.x
2 parents 18b5652 + 067bfd8 commit fa47df8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1745
-305
lines changed

.github/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@
7474

7575
- **这是 Unity 的资源加载接口(CLI)包。它提供了一组命令和工具来增强效率和开发体验。**
7676
> [!IMPORTANT]
77-
> -**支持 Unity 2019.1 及以上版本**
77+
> -**支持 Unity 2019.4 及以上版本**
7878
> -**支持 资源 同步加载/异步加载/协程加载 接口**
7979
> -**支持 资源 本地模式/远程模式/编译器模式 接口**
8080
> -**支持 空包 首包 整包 自定义分包**
8181
> -**支持 Android/iOS/Windows/Mac/WebGL**
8282
> -**支持 CI/CD 流水线资源打包**
83-
> -**支持 .NET 4.0 or later**
83+
> -**支持 .NET 4.x**
8484
> -**支持 il2cpp**
8585
> -**支持 Unity 增量构建**
8686
> -**支持 [UniTask](https://github.com/Cysharp/UniTask)**

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 支持的 Unity 版本
1212

13-
Unity 开源插件目前支持的最低 Unity 版本是 2019.1。我们建议用户使用支持的 Unity 版本以确保插件的正常运行和安全性。
13+
Unity 开源插件目前支持的最低 Unity 版本是 2019.4。我们建议用户使用支持的 Unity 版本以确保插件的正常运行和安全性。
1414

1515
## 安全更新政策
1616

Editor/Proxy/AssetBuildCommand.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*|============|*|
2-
|*|Author: |*| xinan
3-
|*|Date: |*| 2024-01-07
2+
|*|Author: |*| xinan
3+
|*|Date: |*| 2024-01-07
44
|*|E-Mail: |*| xinansky99@gmail.com
55
|*|============|*/
66

@@ -76,6 +76,14 @@ public class AssetBuildCommand : ArgumentCustom
7676
/// </summary>
7777
public const string C_PACKAGE_VERSION = PREFIX + nameof(PackageVersion);
7878

79+
/// <summary>
80+
/// 合并对比至Latest
81+
/// </summary>
82+
public const string C_MERGE_TO_LATEST = PREFIX + nameof(MergeToLatest);
83+
84+
[Argument(C_MERGE_TO_LATEST, EArgLabel.Bool)]
85+
public bool MergeToLatest = false;
86+
7987
[Argument(C_VERIFY_BUILDING_RESULT, EArgLabel.Bool)]
8088
public bool VerifyBuildingResult = true;
8189

Editor/Proxy/AssetProxyEditor.cs

Lines changed: 92 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*|============|*|
2-
|*|Author: |*| xinan
3-
|*|Date: |*| 2024-01-07
2+
|*|Author: |*| xinan
3+
|*|Date: |*| 2024-01-07
44
|*|E-Mail: |*| xinansky99@gmail.com
55
|*|============|*/
66

77
using System;
88
using UnityEditor;
99
using UnityEditor.SceneManagement;
10+
using UnityEngine;
1011
using UnityEngine.SceneManagement;
1112

1213
namespace AIO.UEditor
@@ -45,6 +46,35 @@ public static void CreateConfig(string BundlesDir, bool isTips = false)
4546
Editor.CreateConfig(BundlesDir);
4647
}
4748

49+
/// <summary>
50+
/// 上传到GCloud
51+
/// </summary>
52+
public static void UploadGCloud(ASUploadGCloudConfig config, bool isTips = false)
53+
{
54+
if (Editor is null)
55+
{
56+
if (isTips) TipsInstall();
57+
return;
58+
}
59+
60+
Editor.UploadGCloud(config);
61+
}
62+
63+
64+
/// <summary>
65+
/// 上传到Ftp
66+
/// </summary>
67+
public static void UploadFtp(ASUploadFTPConfig config, bool isTips = false)
68+
{
69+
if (Editor is null)
70+
{
71+
if (isTips) TipsInstall();
72+
return;
73+
}
74+
75+
Editor.UploadFtp(config);
76+
}
77+
4878
public static void BuildArt(ASBuildConfig config, bool isTips = false)
4979
{
5080
if (Editor is null)
@@ -58,6 +88,19 @@ public static void BuildArt(ASBuildConfig config, bool isTips = false)
5888
Editor.BuildArt(config);
5989
}
6090

91+
public static void BuildArt(AssetBuildCommand command, bool isTips = false)
92+
{
93+
if (Editor is null)
94+
{
95+
if (isTips) TipsInstall();
96+
return;
97+
}
98+
99+
SaveScene();
100+
101+
Editor.BuildArt(command);
102+
}
103+
61104
public static void ConvertConfig(AssetCollectRoot config, bool isTips = false)
62105
{
63106
if (Editor is null)
@@ -72,51 +115,63 @@ public static void ConvertConfig(AssetCollectRoot config, bool isTips = false)
72115
private static void SaveScene()
73116
{
74117
var currentScene = SceneManager.GetSceneAt(0);
75-
if (!string.IsNullOrEmpty(currentScene.path))
118+
if (string.IsNullOrEmpty(currentScene.path)) return;
119+
var scene = SceneManager.GetSceneByPath(currentScene.path);
120+
if (!scene.isDirty) return; // 获取当前场景的修改状态
121+
if (EditorUtility.DisplayDialog("提示", "当前场景未保存,是否保存?", "保存", "取消"))
122+
EditorSceneManager.SaveScene(scene);
123+
}
124+
125+
private class InstallPopup : EditorWindow
126+
{
127+
private enum Types
128+
{
129+
[InspectorName("YooAsset [Latest]")] YooAsset,
130+
}
131+
132+
private bool isCN;
133+
private Types type;
134+
135+
private void Awake()
76136
{
77-
var scene = SceneManager.GetSceneByPath(currentScene.path);
78-
if (scene.isDirty) // 获取当前场景的修改状态
137+
// 位置显示在屏幕中间
138+
var temp = Screen.currentResolution;
139+
position = new Rect(
140+
temp.width / 2f,
141+
temp.height / 2f,
142+
300,
143+
50);
144+
}
145+
146+
private void OnGUI()
147+
{
148+
GELayout.Separator();
149+
using (GELayout.VHorizontal())
150+
{
151+
type = GELayout.Popup(type);
152+
isCN = GELayout.ToggleLeft("国区", isCN, GUILayout.Width(45));
153+
}
154+
155+
GELayout.Separator();
156+
if (GELayout.Button("确定"))
79157
{
80-
if (EditorUtility.DisplayDialog("提示", "当前场景未保存,是否保存?", "保存", "取消"))
158+
switch (type)
81159
{
82-
EditorSceneManager.SaveScene(scene);
160+
case Types.YooAsset:
161+
EHelper.Ghost.OpenupmInstall("com.tuyoogame.yooasset", "1.5.7", isCN);
162+
break;
83163
}
164+
165+
Close();
84166
}
85167
}
86168
}
87169

88170
private static void TipsInstall()
89171
{
90-
// switch (EditorUtility.DisplayDialogComplex(
91-
// "提示",
92-
// "当前没有导入资源实现工具",
93-
// $"导入 YooAsset [{Ghost.YooAsset.Version}]",
94-
// "取消",
95-
// $"导入 YooAsset [{Ghost.YooAsset.Version}][CN]"))
96-
// {
97-
// case 0:
98-
// Ghost.YooAsset.Install();
99-
// Console.WriteLine("导入 YooAsset");
100-
// return;
101-
// case 1: // 取消
102-
// break;
103-
// case 2:
104-
// Ghost.YooAsset.InstallCN();
105-
// Console.WriteLine("导入 YooAsset[CN]");
106-
// break;
107-
// }
172+
var window = ScriptableObject.CreateInstance<InstallPopup>();
173+
window.titleContent = new GUIContent("提示");
174+
window.ShowUtility();
108175
}
109176
}
110-
111-
public interface IAssetProxyEditor
112-
{
113-
string Version { get; }
114-
string Scopes { get; }
115-
string Name { get; }
116-
117-
void ConvertConfig(AssetCollectRoot config);
118-
void CreateConfig(string BundlesDir);
119-
120-
void BuildArt(ASBuildConfig config);
121-
}
122177
}

Editor/Proxy/IAssetProxyEditor.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*|============|*|
2+
|*|Author: |*| Star fire
3+
|*|Date: |*| 2024-01-08
4+
|*|E-Mail: |*| xinansky99@gmail.com
5+
|*|============|*/
6+
7+
using System.Threading.Tasks;
8+
9+
namespace AIO.UEditor
10+
{
11+
public interface IAssetProxyEditor
12+
{
13+
/// <summary>
14+
/// 版本号
15+
/// </summary>
16+
string Version { get; }
17+
18+
/// <summary>
19+
/// 作用域
20+
/// </summary>
21+
string Scopes { get; }
22+
23+
/// <summary>
24+
/// 名称
25+
/// </summary>
26+
string Name { get; }
27+
28+
/// <summary>
29+
/// 转换配置
30+
/// </summary>
31+
/// <param name="config">收集器配置</param>
32+
void ConvertConfig(AssetCollectRoot config);
33+
34+
/// <summary>
35+
/// 创建配置
36+
/// </summary>
37+
/// <param name="bundlesDir">导出目标文件夹</param>
38+
void CreateConfig(string bundlesDir);
39+
40+
/// <summary>
41+
/// 构建资源
42+
/// </summary>
43+
/// <param name="command">构建命令</param>
44+
void BuildArt(AssetBuildCommand command);
45+
46+
/// <summary>
47+
/// 构建资源
48+
/// </summary>
49+
/// <param name="config">构建配置</param>
50+
void BuildArt(ASBuildConfig config);
51+
52+
/// <summary>
53+
/// 上传到GCloud
54+
/// 生成一份清单文件 记录当前文件夹下的所有文件的MD5值
55+
/// 在上传的时候会对比清单文件的MD5值 如果一致则不上传
56+
/// 如果不一致 则拉取清单文件中的文件进行对比 记录需要上传的文件
57+
/// 然后再将需要上传的文件上传到GCloud 上传完成后更新清单文件
58+
/// Tips:
59+
/// 需要本地保留一份原始清单 否则会覆盖远端最新的清单文件 导致无法对比
60+
/// </summary>
61+
Task UploadGCloud(ASUploadGCloudConfig config);
62+
63+
/// <summary>
64+
/// 上传到Ftp
65+
/// </summary>
66+
Task UploadFtp(ASUploadFTPConfig config);
67+
}
68+
}

Editor/Proxy/IAssetProxyEditor.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/Windows/AssetCollectWindow.Data.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ partial void GCInit()
543543
ViewRectUpdate();
544544
GPInit();
545545

546-
GC_ToConvert = GEContent.NewApp("Yooasset", "转换为第三方配置文件");
546+
GC_ToConvert = GEContent.NewSettingCustom("Editor/Icon/Yooasset", "转换为第三方配置文件");
547547

548548
GC_SAVE = GEContent.NewBuiltin("d_SaveAs", "保存");
549549
GC_LookMode_Object_Select = GEContent.NewBuiltin("d_scenepicking_pickable_hover", "选择指向指定资源");
@@ -560,14 +560,14 @@ partial void GCInit()
560560
GC_ADD = GEContent.NewSetting("新增", "添加元素");
561561
GC_DEL = GEContent.NewSetting("删除", "删除元素");
562562
GC_CLEAR = GEContent.NewSetting("cancel", "清空元素");
563-
GC_OPEN = GEContent.NewSetting("操作", "打开");
563+
GC_OPEN = GEContent.NewSettingCustom("Editor/Setting/icon_information", "打开指定查询模式");
564564
GC_SyncData = GEContent.NewSetting("下载", "下载");
565565
GC_LookMode_Data_Sort = GEContent.NewSetting("ic_sort", "排序方式");
566-
GC_LookMode_Page_MaxLeft = GEContent.NewSetting("Arrows_Arrow_Big_Left", "跳转到第一页");
567-
GC_LookMode_Page_Left = GEContent.NewSetting("Arrows_Arrow_Left_Bar", "上一页");
568-
GC_LookMode_Page_MaxRight = GEContent.NewSetting("Arrows_Arrow_Right_Bar", "跳转到最后一页");
569-
GC_LookMode_Page_Right = GEContent.NewSetting("Arrows_Arrow_Big_Right", "下一页");
570-
GC_LookMode_Page_Size = GEContent.NewSetting("操作", "设置页面大小");
566+
GC_LookMode_Page_MaxLeft = GEContent.NewSettingCustom("Editor/Icon/Arrows/Arrow_Big_Left", "跳转到第一页");
567+
GC_LookMode_Page_Left = GEContent.NewSettingCustom("Editor/Icon/Arrows/Arrow_Left_Bar", "上一页");
568+
GC_LookMode_Page_MaxRight = GEContent.NewSettingCustom("Editor/Icon/Arrows/Arrow_Right_Bar", "跳转到最后一页");
569+
GC_LookMode_Page_Right = GEContent.NewSettingCustom("Editor/Icon/Arrows/Arrow_Big_Right", "下一页");
570+
GC_LookMode_Page_Size = GEContent.NewSettingCustom("Editor/Setting/icon_setting_2", "设置页面大小");
571571

572572
GC_LookMode_Detail_Tags = new GUIContent("Tags", "资源标签");
573573
GC_LookMode_Detail_GUID = new GUIContent("GUID", "资源GUID");

Editor/Windows/AssetCollectWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ namespace AIO.UEditor
2121
)]
2222
public partial class AssetCollectWindow : GraphicWindow
2323
{
24-
[LnkTools("Asset Window", "#00BFFF", "d_Folder Icon", LnkToolsMode.AllMode, 0)]
24+
[LnkTools(
25+
Tooltip = "AIO 资源管理工具",
26+
IconResource = "Editor/Icon/Asset"
27+
)]
2528
public static void OpenWindow()
2629
{
2730
EditorApplication.ExecuteMenuItem("AIO/Window/Asset");
@@ -71,7 +74,6 @@ partial void OnDrawHeader()
7174
{
7275
switch (WindowMode)
7376
{
74-
default:
7577
case Mode.Editor:
7678
OnDrawHeaderEditorMode();
7779
break;
@@ -113,7 +115,6 @@ protected void UpdateData()
113115
case Mode.Config:
114116
UpdateDataConfigMode();
115117
break;
116-
default:
117118
case Mode.Editor:
118119

119120
break;
@@ -142,7 +143,6 @@ protected override void OnDraw()
142143

143144
switch (WindowMode)
144145
{
145-
default:
146146
case Mode.Editor:
147147
OnDrawEditorMode();
148148
break;

0 commit comments

Comments
 (0)