From 4216d5c8022df1d7efecbfcb2161ea5198afd811 Mon Sep 17 00:00:00 2001 From: Star fire Date: Mon, 24 Jun 2024 17:47:05 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9C=A8=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7c6a41..f13ef52 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "url": "https://github.com/AIO-GAME/Unity.Asset.CLI.git" }, "relatedPackages": { - "com.aio.package": "1.0.47-preview", + "com.aio.package": "1.0.48-preview", "com.aio.runner": "1.0.1-preview" }, "keywords": [ From 5becfd3f1d2d91342fa7c34b476fbe1c14fd4650 Mon Sep 17 00:00:00 2001 From: Star fire Date: Tue, 25 Jun 2024 16:18:05 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Properties/AssemblyInfo.cs | 3 ++- .../YooAsset/AsyncOperationBaseExtensions.cs | 5 +++-- Extensions/YooAsset.CLI/Editor/LnkToolYooAsset.cs | 15 ++++++--------- Extensions/YooAsset.CLI/Runtime/1.5.7/Proxy.cs | 4 +++- Runtime/Properties/AssemblyInfo.cs | 4 +++- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Editor/Properties/AssemblyInfo.cs b/Editor/Properties/AssemblyInfo.cs index 5dfec53..7da7887 100644 --- a/Editor/Properties/AssemblyInfo.cs +++ b/Editor/Properties/AssemblyInfo.cs @@ -7,6 +7,7 @@ using PackageInfo = UnityEditor.PackageManager.PackageInfo; [assembly: InternalsVisibleTo("AIO.CLI.YooAsset.Editor")] +[assembly: UnityAPICompatibilityVersion("2019.4.0", true)] #endregion @@ -132,4 +133,4 @@ private static SettingsProvider CreateSettingsProvider() return provider; } } -} \ No newline at end of file +} diff --git a/Extensions/UniTask/YooAsset/AsyncOperationBaseExtensions.cs b/Extensions/UniTask/YooAsset/AsyncOperationBaseExtensions.cs index 4e77e08..1033c20 100644 --- a/Extensions/UniTask/YooAsset/AsyncOperationBaseExtensions.cs +++ b/Extensions/UniTask/YooAsset/AsyncOperationBaseExtensions.cs @@ -1,8 +1,9 @@ #if UNITASK_YOOASSET_SUPPORT && UNITASK_SUPPORT using System; +using UnityEngine; using YooAsset; using static Cysharp.Threading.Tasks.Internal.Error; - +[assembly: UnityAPICompatibilityVersion("2019.4.0", true)] namespace Cysharp.Threading.Tasks { public static class AsyncOperationBaseExtensions @@ -152,4 +153,4 @@ public bool MoveNext() } } -#endif \ No newline at end of file +#endif diff --git a/Extensions/YooAsset.CLI/Editor/LnkToolYooAsset.cs b/Extensions/YooAsset.CLI/Editor/LnkToolYooAsset.cs index 4ee70c1..d209cd2 100644 --- a/Extensions/YooAsset.CLI/Editor/LnkToolYooAsset.cs +++ b/Extensions/YooAsset.CLI/Editor/LnkToolYooAsset.cs @@ -1,5 +1,8 @@ #if SUPPORT_YOOASSET using UnityEditor; +using UnityEngine; + +[assembly: UnityAPICompatibilityVersion("2019.4.0", true)] namespace AIO.UEditor.CLI { @@ -8,14 +11,8 @@ namespace AIO.UEditor.CLI /// public static class LnkToolYooAsset { - [LnkTools( - Tooltip = "YooAsset Collector", - IconResource = "Editor/Icon/Yooasset" - )] - public static void OpenWindow() - { - EditorApplication.ExecuteMenuItem("YooAsset/AssetBundle Collector"); - } + [LnkTools(Tooltip = "YooAsset Collector", IconResource = "Editor/Icon/Yooasset")] + public static void OpenWindow() { EditorApplication.ExecuteMenuItem("YooAsset/AssetBundle Collector"); } } } -#endif \ No newline at end of file +#endif diff --git a/Extensions/YooAsset.CLI/Runtime/1.5.7/Proxy.cs b/Extensions/YooAsset.CLI/Runtime/1.5.7/Proxy.cs index 8273be1..dab9834 100644 --- a/Extensions/YooAsset.CLI/Runtime/1.5.7/Proxy.cs +++ b/Extensions/YooAsset.CLI/Runtime/1.5.7/Proxy.cs @@ -1,9 +1,11 @@ #if SUPPORT_YOOASSET using System.Linq; +using UnityEngine; using UnityEngine.Scripting; using YooAsset; +[assembly: UnityAPICompatibilityVersion("2019.4.0", true)] [assembly: Preserve] #if UNITY_2018_3_OR_NEWER [assembly: AlwaysLinkAssembly] @@ -62,4 +64,4 @@ public bool CheckLocationValid(string location, out string assetPath) public override IASNetLoading GetLoadingHandle() { return new LoadingInfo(); } } } -#endif \ No newline at end of file +#endif diff --git a/Runtime/Properties/AssemblyInfo.cs b/Runtime/Properties/AssemblyInfo.cs index 8f765c1..b73927f 100644 --- a/Runtime/Properties/AssemblyInfo.cs +++ b/Runtime/Properties/AssemblyInfo.cs @@ -2,10 +2,12 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using UnityEngine; using UnityEngine.Scripting; #endregion +[assembly: UnityAPICompatibilityVersion("2019.4.0", true)] [assembly: Preserve] #if UNITY_2018_3_OR_NEWER [assembly: AlwaysLinkAssembly] @@ -16,4 +18,4 @@ [assembly: InternalsVisibleTo("AIO.FGUI.Runtime")] [assembly: InternalsVisibleTo("AIO.FGUI.Editor")] [assembly: InternalsVisibleTo("AIO.CLI.YooAsset.Runtime")] -[assembly: InternalsVisibleTo("AIO.CLI.YooAsset.Editor")] \ No newline at end of file +[assembly: InternalsVisibleTo("AIO.CLI.YooAsset.Editor")] From 36d487e97d9995235e30da131f4a8dc114d8b51d Mon Sep 17 00:00:00 2001 From: Star fire Date: Tue, 2 Jul 2024 08:38:42 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E2=9C=A8=20=E5=85=BC=E5=AE=B9=20mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Windows/Page/2AssetPage.EditConfig.cs | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Editor/Windows/Page/2AssetPage.EditConfig.cs b/Editor/Windows/Page/2AssetPage.EditConfig.cs index 8c59640..fdad085 100644 --- a/Editor/Windows/Page/2AssetPage.EditConfig.cs +++ b/Editor/Windows/Page/2AssetPage.EditConfig.cs @@ -100,10 +100,11 @@ void IAssetPage.UpdateData() Config.Packages[0].IsDefault = true; } - void IAssetPage.EventMouseDown(in Event evt) => ViewConfig.ContainsDragStretch(evt, ViewRect.DragStretchType.Horizontal); - void IAssetPage.EventMouseUp(in Event evt) => ViewConfig.CancelDragStretch(); - void IAssetPage.EventMouseDrag(in Event evt) => ViewConfig.DraggingStretch(evt, ViewRect.DragStretchType.Horizontal); - void IAssetPage.EventKeyUp(in Event evt, in KeyCode keyCode) { } + void IAssetPage.EventMouseDown(in Event evt) => ViewConfig.ContainsDragStretch(evt, ViewRect.DragStretchType.Horizontal); + void IAssetPage.EventMouseUp(in Event evt) => ViewConfig.CancelDragStretch(); + void IAssetPage.EventMouseDrag(in Event evt) => ViewConfig.DraggingStretch(evt, ViewRect.DragStretchType.Horizontal); + + void IAssetPage.EventKeyUp(in Event evt, in KeyCode keyCode) { } void IAssetPage.EventKeyDown(in Event evt, in KeyCode keyCode) { @@ -285,12 +286,14 @@ private void OnDrawASConfig(Rect rect) GUI.Label(cell, #if UNITY_ANDROID $"编辑器 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}" -#elif UNITY_STANDALONE_WIN - $"编辑器 : {EHelper.Path.Project}/{Config.RuntimeRootDirectory}" +#elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX + $"编辑器 : {EHelper.Path.Project}/{Config.RuntimeRootDirectory}" #elif UNITY_IPHONE || UNITY_IOS - $"编辑器 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}" + $"编辑器 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}" #elif UNITY_WEBGL - $"编辑器 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}" + $"编辑器 : Application.streamingAssetsPath/{Config.RuntimeRootDirectory}" +#else + "Not Support" #endif , GEStyle.HeaderLabel); } @@ -302,7 +305,7 @@ private void OnDrawASConfig(Rect rect) GUI.Label(cell, string.Format("运行时 : {0}/{1}", #if UNITY_ANDROID "Application.persistentDataPath" -#elif UNITY_STANDALONE_WIN +#elif UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX "Application.streamingAssetsPath" #elif UNITY_IPHONE || UNITY_IOS "Application.persistentDataPath" @@ -410,4 +413,4 @@ private void OnDrawASConfig(Rect rect) } } } -} \ No newline at end of file +} From 63a1e3691920bb574339383b9222d86316f7a295 Mon Sep 17 00:00:00 2001 From: Star fire Date: Tue, 2 Jul 2024 08:39:26 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E2=9C=A8=20up=20version=201.x=20->=201.1?= =?UTF-8?q?.15-preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f13ef52..8e80bc7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.aio.cli.asset", "displayName": "AIO Unity CLI Asset", "description": "unity3d resources management system.", - "version": "1.1.14-preview", + "version": "1.1.15-preview", "unity": "2019.4", "category": "Runtime", "unityRelease": "0f1", @@ -15,8 +15,8 @@ "url": "https://github.com/AIO-GAME/Unity.Asset.CLI.git" }, "relatedPackages": { - "com.aio.package": "1.0.48-preview", - "com.aio.runner": "1.0.1-preview" + "com.aio.package": "1.0.49-preview", + "com.aio.runner": "1.0.2-preview" }, "keywords": [ "Asset", From 0b57cf4b11aa912c1e9aa089af10daf6c06100bb Mon Sep 17 00:00:00 2001 From: Star fire Date: Tue, 2 Jul 2024 15:27:37 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .batch/YooAssetBuild.py | 190 ++++++++++++++++++ .../Editor/1.5.7/Command/YooAssetBuild.cs | 4 +- 2 files changed, 192 insertions(+), 2 deletions(-) create mode 100644 .batch/YooAssetBuild.py diff --git a/.batch/YooAssetBuild.py b/.batch/YooAssetBuild.py new file mode 100644 index 0000000..d885eb7 --- /dev/null +++ b/.batch/YooAssetBuild.py @@ -0,0 +1,190 @@ +# -*- coding: UTF-8 -*- + +import os +import stat +import ctypes, sys + +def enum(label, keyList, valueList): + print("\n======================================================================") + print("- 请选择" + label + ":") + for x in range(len(keyList)): + print("- " + str(x + 1) + ":" + keyList[x]) + pass + print("- other:忽略") + index = int(input('')) - 1 + maxIndex = len(valueList) + if (index > maxIndex): + return "null" + for x in range(maxIndex): + if (x == index): + return valueList[x] + pass + return "null" + +def UnityRun(MethodArgs): + print("- 请输入 unity.exe 文件路径:") + value = str(input('')) + unityExe = "D:\\Unity\\Unity2020.3.37f1\\Editor\\Unity.exe" + if (len(value) > 0): unityExe = value + + # 项目路径 + print("- 请输入 unity 项目路径:") + value = str(input('')) + projectPath = "E:\\TencentGit\\AIO20200337\\" + if (len(value) > 0): projectPath = value + + # 日志文件输出路径 + print("- 请输入 日志文件输出路径:") + value = str(input('')) + logfile = "E:\\TencentGit\\AIO20200337\\Build\\test\\beedom20230104.android.log" + if (len(value) > 0): logfile = value + + # Unity执行函数 + print("- 请输入 Unity 执行函数:") + value = str(input('')) + executeMethod = "AIO.Build.Editor.YooAssetBuild.ArtBuild" + if (len(value) > 0): executeMethod = value + + command = unityExe + " -projectPath " + projectPath +" -quit -batchmode -logfile " + logfile + " -executeMethod " + executeMethod + " \"" + MethodArgs + "|\"" + + print(command) + print("\n开始执行 请稍等") + os.system(command) + +def main(): + os.system("@echo off&@setlocal enabledelayedexpansion") + os.system("@chcp 65001&@color F") + + ## -----说明文字----- + print("\n======================================================================") + print("- Welcome :美术资源打包") + print("======================================================================\n") + + args = [] + #-------------------------------------------------------------- + keyList = [] + keyList.append("BuiltinBuildPipeline (传统内置构建管线)") + keyList.append("ScriptableBuildPipeline (可编程构建管线)") + + valueList = [] + valueList.append("b@BuildPipeline BuiltinBuildPipeline") + valueList.append("b@BuildPipeline ScriptableBuildPipeline") + + value = enum("BuildPipeline 构建管线类型 (必选)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + keyList = [] + keyList.append("None (不拷贝任何文件)") + keyList.append("ClearAndCopyAll (先清空已有文件,然后拷贝所有文件)") + keyList.append("ClearAndCopyByTags (先清空已有文件,然后按照资源标签拷贝文件)") + keyList.append("OnlyCopyAll (不清空已有文件,直接拷贝所有文件)") + keyList.append("OnlyCopyByTags (不清空已有文件,直接按照资源标签拷贝文件)") + + valueList = [] + valueList.append("b@BuildPipeline None") + valueList.append("b@BuildPipeline ClearAndCopyAll") + valueList.append("b@BuildPipeline ClearAndCopyByTags") + valueList.append("b@BuildPipeline OnlyCopyAll") + valueList.append("b@BuildPipeline OnlyCopyByTags") + + value = enum("BuildPipeline 首包资源文件的拷贝方式: (可忽略)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + keyList = [] + keyList.append("HashName (哈希值名称)") + keyList.append("BundleName_HashName (资源包名称 + 哈希值名称)") + + valueList = [] + valueList.append("b@OutputNameStyle HashName") + valueList.append("b@OutputNameStyle BundleName_HashName") + + value = enum("OutputNameStyle 输出文件名称的样式: (可忽略)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + keyList = [] + keyList.append("ForceRebuild (强制重建模式)") + keyList.append("IncrementalBuild (增量构建模式)") + keyList.append("DryRunBuild (演练构建模式)") + keyList.append("SimulateBuild (模拟构建模式)") + + valueList = [] + valueList.append("b@BuildMode ForceRebuild") + valueList.append("b@BuildMode IncrementalBuild") + valueList.append("b@BuildMode DryRunBuild") + valueList.append("b@BuildMode SimulateBuild") + + value = enum("BuildMode 资源包流水线的构建模式: (可忽略)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + keyList = [] + keyList.append("Android (安卓)") + keyList.append("iOS (苹果)") + keyList.append("WebGL (Web网页)") + keyList.append("StandaloneWindows (PC)") + + valueList = [] + valueList.append("b@ActiveTarget Android") + valueList.append("b@ActiveTarget iOS") + valueList.append("b@ActiveTarget WebGL") + valueList.append("b@ActiveTarget StandaloneWindows") + + value = enum("ActiveTarget 资源打包目标平台: (可忽略)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + keyList = [] + keyList.append("Uncompressed") + keyList.append("LZMA") + keyList.append("LZ4") + + valueList = [] + valueList.append("b@CompressOption Uncompressed") + valueList.append("b@CompressOption LZMA") + valueList.append("b@CompressOption LZ4") + + value = enum("CompressOption AssetBundle压缩选项: (可忽略)", keyList, valueList) + if (value != "null"): args.append(value) + #-------------------------------------------------------------- + print("- 请输入 输出根目录:") + value = str(input('')) + if (len(value) > 0): args.append("b@OutputRoot " + value) + #-------------------------------------------------------------- + print("- 请输入 资源目标包:") + value = str(input('')) + if (len(value) > 0): args.append("b@BuildPackage " + value) + #-------------------------------------------------------------- + print("- 请输入 资源目标版本:") + value = str(input('')) + if (len(value) > 0): args.append("b@PackageVersion " + value) + #-------------------------------------------------------------- + print("- 请输入 首包资源文件的标签集合: (可忽略)") + value = str(input('')) + if (len(value) > 0): args.append("b@CopyBuildinFileTags " + value) + #-------------------------------------------------------------- + print("- 请输入 加密类名称: (可忽略)") + value = str(input('')) + if (len(value) > 0): args.append("b@EncyptionClassName " + value) + #-------------------------------------------------------------- + print("- 请输入 验证构建结果 1:验证 other:忽略 (可忽略)") + value = str(input('')) + if (value == "1"): args.append("b@VerifyBuildingResult ") + + print("\n======================================================================") + arg = '' + for index in range(len(args)): + arg = arg + ' ' +args[index] + print(args[index]) + pass + print("======================================================================\n") + + UnityRun(arg) + + + print("- 打包完成: 输入任意键退出本程序") + str(input('')) + +def is_admin(): + try: return ctypes.windll.shell32.IsUserAnAdmin() + except: return False + +if is_admin(): main() +else: ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1) \ No newline at end of file diff --git a/Extensions/YooAsset.CLI/Editor/1.5.7/Command/YooAssetBuild.cs b/Extensions/YooAsset.CLI/Editor/1.5.7/Command/YooAssetBuild.cs index fd56a39..473e81b 100644 --- a/Extensions/YooAsset.CLI/Editor/1.5.7/Command/YooAssetBuild.cs +++ b/Extensions/YooAsset.CLI/Editor/1.5.7/Command/YooAssetBuild.cs @@ -44,7 +44,7 @@ public static void ArtBuild() if (Enum.IsDefined(typeof(ECopyBuildInFileOption), buildArgs.CopyBuildInFileOption)) buildArgs.CopyBuildInFileOption = ECopyBuildInFileOption.None; - if (Enum.IsDefined(typeof(ECompressOption), buildArgs.CompressOption)) + if (Enum.IsDefined(typeof(ECompressMode), buildArgs.CompressOption)) buildArgs.CompressOption = ECompressMode.LZ4; if (Enum.IsDefined(typeof(EBuildPipeline), buildArgs.BuildPipeline)) @@ -418,4 +418,4 @@ private static void MergeToLatest(string rootPath, string version) } } } -#endif \ No newline at end of file +#endif From 5ccf39116662a74bfab23586694d00dcf67045f1 Mon Sep 17 00:00:00 2001 From: Star fire Date: Fri, 5 Jul 2024 10:55:01 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E2=9C=A8=20=E4=BC=98=E5=8C=96=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Inspector/AssetConfigCommonEditor.cs | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Editor/Windows/Inspector/AssetConfigCommonEditor.cs b/Editor/Windows/Inspector/AssetConfigCommonEditor.cs index aeb9f5c..6653e0c 100644 --- a/Editor/Windows/Inspector/AssetConfigCommonEditor.cs +++ b/Editor/Windows/Inspector/AssetConfigCommonEditor.cs @@ -31,8 +31,7 @@ public void OnActivation() HeaderIcon = AssetPreview.GetMiniThumbnail(ASConfig); UpdateRecordQueue(); - PackageNames = ACConfig.GetNames(); - if (PackageNames is null) PackageNames = Array.Empty(); + PackageNames = ACConfig.GetNames() ?? Array.Empty(); PackageNameIndex = PackageNames.ToList().IndexOf(ABConfig.PackageName); } @@ -81,7 +80,7 @@ private void OnDrawACConfig() #if UNITY_2021_1_OR_NEWER AssetDatabase.SaveAssetIfDirty(ACConfig); #else - AssetDatabase.SaveAssets(); + AssetDatabase.SaveAssets(); #endif if (EditorUtility.DisplayDialog("保存", "保存成功", "确定")) AssetDatabase.Refresh(); } @@ -135,13 +134,14 @@ private void OnDrawACConfig() #region ASBuildConfigEditor private AssetBuildConfig ABConfig; - private bool FoldoutABConfig = true; - private int PackageNameIndex = 0; + private bool FoldoutABConfig = true; + private int PackageNameIndex; private void OnDrawABConfig() { GUILayout.Space(5); using (GELayout.Vertical(GEStyle.TEBoxBackground)) + { if (ABConfig) { using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) @@ -159,14 +159,18 @@ private void OnDrawABConfig() EditorApplication.ExecuteMenuItem(AssetWindow.MENU_WINDOW); } - if (GUILayout.Button("构建", GEStyle.toolbarbutton)) AssetProxyEditor.BuildArt(ABConfig); + if (GUILayout.Button("构建", GEStyle.toolbarbutton)) + { + AssetProxyEditor.BuildArt(ABConfig); + GUIUtility.ExitGUI(); + return; + } } using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) { EditorGUILayout.LabelField("构建平台", GTOptions.Width(125)); - ABConfig.BuildTarget = - (BuildTarget)EditorGUILayout.EnumPopup(ABConfig.BuildTarget, GEStyle.TEToolbarDropDown); + ABConfig.BuildTarget = (BuildTarget)EditorGUILayout.EnumPopup(ABConfig.BuildTarget, GEStyle.TEToolbarDropDown); } using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) @@ -185,8 +189,7 @@ private void OnDrawABConfig() using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) { EditorGUILayout.LabelField("压缩模式", GTOptions.Width(125)); - ABConfig.CompressedMode = - (ECompressMode)EditorGUILayout.EnumPopup(ABConfig.CompressedMode, GEStyle.TEToolbarDropDown); + ABConfig.CompressedMode = (ECompressMode)EditorGUILayout.EnumPopup(ABConfig.CompressedMode, GEStyle.TEToolbarDropDown); } using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) @@ -201,9 +204,15 @@ private void OnDrawABConfig() using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) { EditorGUILayout.LabelField("构建资源包名称", GTOptions.Width(125)); - EditorGUI.BeginChangeCheck(); PackageNameIndex = EditorGUILayout.Popup(PackageNameIndex, PackageNames, GEStyle.PreDropDown); - if (EditorGUI.EndChangeCheck()) ABConfig.PackageName = ACConfig.GetNames()[PackageNameIndex]; + using (var scope = new EditorGUI.ChangeCheckScope()) + { + if (scope.changed) + { + var temp = ACConfig.GetNames(); + ABConfig.PackageName = temp.Length > PackageNameIndex ? temp[PackageNameIndex] : string.Empty; + } + } } using (new EditorGUILayout.HorizontalScope(GEStyle.Toolbar)) @@ -271,6 +280,7 @@ private void OnDrawABConfig() if (GUILayout.Button("Create", GEStyle.toolbarbuttonRight)) Selection.activeObject = AssetBuildConfig.GetOrCreate(); } } + } } #endregion @@ -566,4 +576,4 @@ private void Update() #endregion } -} \ No newline at end of file +} From 83c97856dc34f50d3c36ad4eacf0d9f6c8c78866 Mon Sep 17 00:00:00 2001 From: Star fire Date: Fri, 5 Jul 2024 10:56:04 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E2=9C=A8=20up=20version=201.x=20->=201.1?= =?UTF-8?q?.16-preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8e80bc7..12e66de 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.aio.cli.asset", "displayName": "AIO Unity CLI Asset", "description": "unity3d resources management system.", - "version": "1.1.15-preview", + "version": "1.1.16-preview", "unity": "2019.4", "category": "Runtime", "unityRelease": "0f1", @@ -15,7 +15,7 @@ "url": "https://github.com/AIO-GAME/Unity.Asset.CLI.git" }, "relatedPackages": { - "com.aio.package": "1.0.49-preview", + "com.aio.package": "1.0.50-preview", "com.aio.runner": "1.0.2-preview" }, "keywords": [ From 52c590e6de3d6fcfa6a4ad902c6df8fd155abfae Mon Sep 17 00:00:00 2001 From: Star fire Date: Sat, 28 Sep 2024 09:31:59 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E2=9C=A8=20=E4=BF=AE=E6=94=B9=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/qodana.yaml | 35 ------- .github/workflows/code_quality.yml | 30 ------ .../Data/Collect/Item/AssetCollectItemEx.cs | 6 +- Editor/Windows/AssetWindow.cs | 4 +- Editor/Windows/Page/1AssetPage.EditCollect.cs | 14 ++- Editor/Windows/Page/4AssetPage.LookCollect.cs | 94 ++++++++++--------- Editor/Windows/Page/AssetPage.Look.cs | 13 +-- 7 files changed, 67 insertions(+), 129 deletions(-) delete mode 100644 .github/qodana.yaml delete mode 100644 .github/workflows/code_quality.yml diff --git a/.github/qodana.yaml b/.github/qodana.yaml deleted file mode 100644 index d3a7637..0000000 --- a/.github/qodana.yaml +++ /dev/null @@ -1,35 +0,0 @@ -#-------------------------------------------------------------------------------# -# Qodana analysis is configured by qodana.yaml file # -# https://www.jetbrains.com/help/qodana/qodana-yaml.html # -#-------------------------------------------------------------------------------# -version: "1.0" -linter: jetbrains/qodana-dotnet:2023.3 -include: - - name: CheckDependencyLicenses - -#Specify IDE code to run analysis without container (Applied in CI/CD pipeline) -ide: QDNET - -#Specify inspection profile for code analysis -profile: - name: qodana.starter - -#Enable inspections -#include: -# - name: - -#Disable inspections -exclude: - - name: All - paths: - - "Resources/Editor" - - "*.meta" - - "*.asmdef" - - "*.tt" - -#Execute shell command before Qodana execution (Applied in CI/CD pipeline) -#bootstrap: sh ./prepare-qodana.sh - -#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline) -#plugins: -# - id: #(plugin id can be found at https://plugins.jetbrains.com) \ No newline at end of file diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml deleted file mode 100644 index ff99505..0000000 --- a/.github/workflows/code_quality.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: 🧬 Code Optimize Qodana -on: - workflow_dispatch: - pull_request: - branches: - - main - push: - tags: # 当生成指定标签时触发 - - '*.*.*' - branches: # Specify your branches here - - main - - '1.*' -jobs: - qodana: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - checks: write - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} # 检查实际的pull请求提交,而不是合并提交 - fetch-depth: 0 # 拉请求分析需要完整的历史记录 - - name: 🧬 Qodana Scan - uses: JetBrains/qodana-action@v2023.3 - with: - pr-mode: false - env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} \ No newline at end of file diff --git a/Editor/Data/Collect/Item/AssetCollectItemEx.cs b/Editor/Data/Collect/Item/AssetCollectItemEx.cs index 3404504..04432f6 100644 --- a/Editor/Data/Collect/Item/AssetCollectItemEx.cs +++ b/Editor/Data/Collect/Item/AssetCollectItemEx.cs @@ -14,8 +14,8 @@ public static string[] GetDisPlayNames(this IEnumerable collec where item.Type == EAssetCollectItemType.MainAssetCollector where !string.IsNullOrEmpty(item.CollectPath) select item.CollectPath - ).Distinct() - .ToArray(); + ).Distinct(). + ToArray(); } } -} \ No newline at end of file +} diff --git a/Editor/Windows/AssetWindow.cs b/Editor/Windows/AssetWindow.cs index d4fe045..5b59042 100644 --- a/Editor/Windows/AssetWindow.cs +++ b/Editor/Windows/AssetWindow.cs @@ -150,7 +150,7 @@ public static T OpenPage() if (!Instance) { EditorApplication.ExecuteMenuItem(MENU_WINDOW); - return default; + return default(T); } Instance.PageIndex = Instance.Pages.IndexOf(Instance.Pages.FirstOrDefault(p => p is T)); @@ -166,4 +166,4 @@ public static bool IsOpenPage() #endregion } -} \ No newline at end of file +} diff --git a/Editor/Windows/Page/1AssetPage.EditCollect.cs b/Editor/Windows/Page/1AssetPage.EditCollect.cs index c1479cb..4266777 100644 --- a/Editor/Windows/Page/1AssetPage.EditCollect.cs +++ b/Editor/Windows/Page/1AssetPage.EditCollect.cs @@ -135,20 +135,23 @@ public static void OpenCollectItem(AssetCollectItem item) { if (item.Type == EAssetCollectItemType.MainAssetCollector) { + int status; var list = AssetCollectRoot.GetOrCreate().CurrentGroup.Collectors.GetDisPlayNames(); if (list.Length > 31) { - AssetPageLook.DisplayCollectorsIndex = 0; + status = 0; for (var i = 0; i < list.Length; i++) + { if (list[i] == item.CollectPath) { - AssetPageLook.DisplayCollectorsIndex = i + 1; + status = i + 1; break; } + } } else { - var status = 1; + status = 1; foreach (var collector in list) { if (collector != item.CollectPath) @@ -157,11 +160,12 @@ public static void OpenCollectItem(AssetCollectItem item) continue; } - AssetPageLook.DisplayCollectorsIndex = status; break; } } + AssetWindow.OpenPage(); + AssetPageLook.DisplayCollectorsIndex = status; return; } @@ -304,4 +308,4 @@ public void OnDrawHeader(Rect rect) EditorGUI.DropShadowLabel(rect, TempBuilder.ToString()); } } -} \ No newline at end of file +} diff --git a/Editor/Windows/Page/4AssetPage.LookCollect.cs b/Editor/Windows/Page/4AssetPage.LookCollect.cs index f7cf9f7..92e8a5e 100644 --- a/Editor/Windows/Page/4AssetPage.LookCollect.cs +++ b/Editor/Windows/Page/4AssetPage.LookCollect.cs @@ -29,8 +29,7 @@ void IAssetPage.EventMouseDrag(in Event evt) if (Instance.ShowAssetDetail) Instance.ViewDetailList.DraggingStretch(evt, ViewRect.DragStretchType.Horizontal); } - bool IAssetPage.Shortcut(Event evt) => - evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad4 || evt.keyCode == KeyCode.Alpha4); + bool IAssetPage.Shortcut(Event evt) => evt.control && evt.type == EventType.KeyDown && (evt.keyCode == KeyCode.Keypad4 || evt.keyCode == KeyCode.Alpha4); public void Dispose() { @@ -50,52 +49,41 @@ public void Dispose() private Dictionary<(int, int), string[]> TagDisplays; private Dictionary<(int, int), ConcurrentBag> DataDic; - public void OnDrawHeader(Rect rect) + private Rect OnDrawGroup(Rect rect) { - if (Data.Packages.Length == 0 || - DisplayPackages is null || - DisplayPackages.Length == 0) return; - - var width = rect.width; - rect.x = 0; - rect.width = 100; - - EditorGUI.BeginChangeCheck(); + using var scope = new EditorGUI.ChangeCheckScope(); Data.CurrentPackageIndex = EditorGUI.Popup(rect, Data.CurrentPackageIndex, DisplayPackages, GEStyle.PreDropDown); - if (!Data.IsValidGroup()) return; + if (!Data.IsValidGroup()) return rect; - var PName = DisplayPackages[Data.CurrentPackageIndex]; - if (!DisplayGroupNames.ContainsKey(PName)) - DisplayGroupNames[PName] = GetGroupDisPlayNames(Data.CurrentPackage.Groups); + var package = DisplayPackages[Data.CurrentPackageIndex]; + if (!DisplayGroupNames.ContainsKey(package)) + DisplayGroupNames[package] = GetGroupDisPlayNames(Data.CurrentPackage.Groups); - if (Data.CurrentGroupIndex >= DisplayGroupNames[PName].Length) - Data.CurrentGroupIndex = DisplayGroupNames[PName].Length - 1; + if (Data.CurrentGroupIndex >= DisplayGroupNames[package].Length) + Data.CurrentGroupIndex = DisplayGroupNames[package].Length - 1; rect.x += rect.width; - Data.CurrentGroupIndex = EditorGUI.Popup(rect, Data.CurrentGroupIndex, DisplayGroupNames[PName], GEStyle.PreDropDown); + Data.CurrentGroupIndex = EditorGUI.Popup(rect, Data.CurrentGroupIndex, DisplayGroupNames[package], GEStyle.PreDropDown); - if (!Data.IsValidCollect()) + if (!Data.IsValidCollect() || !scope.changed) return rect; + if (!DataDic.ContainsKey((Data.CurrentPackageIndex, Data.CurrentGroupIndex))) + UpdateDataCollector(Data.CurrentPackageIndex, Data.CurrentGroupIndex); + else { - EditorGUI.EndChangeCheck(); - return; + PageValues.Clear(); + PageValues.Add(DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)]); + PageValues.PageIndex = 0; + TreeViewQueryAsset.Reload(PageValues); } - if (EditorGUI.EndChangeCheck()) - { - if (!DataDic.ContainsKey((Data.CurrentPackageIndex, Data.CurrentGroupIndex))) - UpdateDataCollector(Data.CurrentPackageIndex, Data.CurrentGroupIndex); - else - { - PageValues.Clear(); - PageValues.Add(DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)]); - PageValues.PageIndex = 0; - TreeViewQueryAsset.Reload(PageValues); - } - } + return rect; + } - EditorGUI.BeginChangeCheck(); - var collectors = CollectorDisplays[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)]; + private Rect OnDrawCollector(Rect rect) + { + using var scope = new EditorGUI.ChangeCheckScope(); + var collectors = CollectorDisplays[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)]; if (collectors.Length > 0) { rect.x += rect.width; @@ -151,18 +139,31 @@ DisplayPackages is null || } else DisplayTagsIndex = 0; - if (EditorGUI.EndChangeCheck()) + if (!scope.changed) return rect; + PageValues.Clear(); + lock (DataDic) { - PageValues.Clear(); - lock (DataDic) - { - PageValues.Add(DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)].Where(data => !FilterData(data))); - } - - PageValues.PageIndex = 0; - TreeViewQueryAsset.Reload(); + PageValues.Add(DataDic[(Data.CurrentPackageIndex, Data.CurrentGroupIndex)].Where(data => !FilterData(data))); } + PageValues.PageIndex = 0; + TreeViewQueryAsset.Reload(); + + return rect; + } + + public void OnDrawHeader(Rect rect) + { + if (Data.Packages.Length == 0 || + DisplayPackages is null || + DisplayPackages.Length == 0) return; + + var width = rect.width; + rect.x = 0; + rect.width = 100; + rect = OnDrawGroup(rect); + rect = OnDrawCollector(rect); + rect.x += rect.width + 3; rect.width = width - 30 - rect.x - (PageValues.Count <= 0 ? 0 : 190); SearchAssetText(rect); @@ -173,6 +174,7 @@ DisplayPackages is null || rect.x = width - 30; rect.width = 30; + if (GUI.Button(rect, Instance.GC_REFRESH, GEStyle.TEtoolbarbutton)) { Instance.SelectAsset = null; @@ -346,4 +348,4 @@ public void OnDrawContent(Rect rect) } } } -} \ No newline at end of file +} diff --git a/Editor/Windows/Page/AssetPage.Look.cs b/Editor/Windows/Page/AssetPage.Look.cs index 129f7af..0025d97 100644 --- a/Editor/Windows/Page/AssetPage.Look.cs +++ b/Editor/Windows/Page/AssetPage.Look.cs @@ -37,9 +37,9 @@ public partial class AssetPageLook private static string[] DisplayCollectors; // 列表:收集器 private static string[] DisplayTypes; // 列表:类型 - public static int DisplayTypeIndex; // 当前选择包类型索引 - public static int DisplayCollectorsIndex = -1; // 当前选择收集器索引 - public static int DisplayTagsIndex; // 当前标签列表索引 + public static int DisplayTypeIndex; // 当前选择包类型索引 + public static int DisplayCollectorsIndex { get; set; } = -1; // 当前选择收集器索引 + public static int DisplayTagsIndex; // 当前标签列表索引 private readonly GUIContent GC_CLEAR; private readonly GUIContent GC_DEL; @@ -615,10 +615,7 @@ private void OnDrawPageSetting(Rect rect) private static string[] GetGroupDisPlayNames(ICollection groups) { var page = groups.Count > 15; - return groups.Select(t => t.Name) - .Where(groupName => !string.IsNullOrEmpty(groupName)) - .Select(groupName => page ? string.Concat(char.ToUpper(groupName[0]), '/', groupName) : groupName) - .ToArray(); + return groups.Select(t => t.Name).Where(groupName => !string.IsNullOrEmpty(groupName)).Select(groupName => page ? string.Concat(char.ToUpper(groupName[0]), '/', groupName) : groupName).ToArray(); } private static string[] GetCollectorDisPlayNames(IList collectors) @@ -641,4 +638,4 @@ private static string[] GetCollectorDisPlayNames(IList collectors) return collectors.ToArray(); } } -} \ No newline at end of file +} From 75e90ba090710646fecddc45521454809fbbf226 Mon Sep 17 00:00:00 2001 From: Star fire Date: Mon, 9 Dec 2024 10:53:06 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Data/AssetBuildConfig.cs | 5 +++++ Editor/Data/Collect/Root/AssetCollectRoot.cs | 4 ++-- .../Data/Collect/Root/AssetCollectRoot.cs.meta | 2 +- Editor/Windows/AssetWindow.cs.meta | 2 +- .../Inspector/AssetConfigCommonEditor.cs | 16 +++++++++++----- .../Runtime/1.5.7/Handle/Load.Asset.cs | 17 +++++++++-------- Runtime/Config/ASConfig.cs | 5 +++++ Runtime/Config/ASConfig.cs.meta | 2 +- 8 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Editor/Data/AssetBuildConfig.cs b/Editor/Data/AssetBuildConfig.cs index 9d1b0e5..75894b2 100644 --- a/Editor/Data/AssetBuildConfig.cs +++ b/Editor/Data/AssetBuildConfig.cs @@ -11,6 +11,11 @@ namespace AIO.UEditor [Serializable] [Description("资源打包配置")] [HelpURL("https://github.com/AIO-GAME/Unity.Asset.CLI/blob/main/.github/API_USAGE/ToolWindow.md#-%E6%89%93%E5%8C%85%E5%B7%A5%E5%85%B7-")] +#if UNITY_2021_1_OR_NEWER + [Icon("Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] +#else + [ScriptIcon(IconRelative = "Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] +#endif public partial class AssetBuildConfig : ScriptableObject { private static AssetBuildConfig _instance; diff --git a/Editor/Data/Collect/Root/AssetCollectRoot.cs b/Editor/Data/Collect/Root/AssetCollectRoot.cs index e964e83..b2322bb 100644 --- a/Editor/Data/Collect/Root/AssetCollectRoot.cs +++ b/Editor/Data/Collect/Root/AssetCollectRoot.cs @@ -19,9 +19,9 @@ namespace AIO.UEditor [Serializable] [HelpURL("https://github.com/AIO-GAME/Unity.Asset.CLI/blob/main/.github/API_USAGE/ToolWindow.md#asset-system-%E5%B7%A5%E5%85%B7%E8%AF%B4%E6%98%8E")] #if UNITY_2021_1_OR_NEWER - [Icon("Packages/com.aio.package/Resources/Editor/Setting/icon_interests.png")] + [Icon("Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] #else - [ScriptIcon(IconRelative = "Packages/com.aio.package/Resources/Editor/Setting/icon_interests.png")] + [ScriptIcon(IconRelative = "Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] #endif public partial class AssetCollectRoot : ScriptableObject { diff --git a/Editor/Data/Collect/Root/AssetCollectRoot.cs.meta b/Editor/Data/Collect/Root/AssetCollectRoot.cs.meta index ad7a964..1495835 100644 --- a/Editor/Data/Collect/Root/AssetCollectRoot.cs.meta +++ b/Editor/Data/Collect/Root/AssetCollectRoot.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: e64cbe7e677953f4b9cb7965c538c9b2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: diff --git a/Editor/Windows/AssetWindow.cs.meta b/Editor/Windows/AssetWindow.cs.meta index d083045..50e073d 100644 --- a/Editor/Windows/AssetWindow.cs.meta +++ b/Editor/Windows/AssetWindow.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5f348746cb614658b580646952f2da8b MonoImporter: - externalObjects: [] + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Editor/Windows/Inspector/AssetConfigCommonEditor.cs b/Editor/Windows/Inspector/AssetConfigCommonEditor.cs index 6653e0c..0a6411b 100644 --- a/Editor/Windows/Inspector/AssetConfigCommonEditor.cs +++ b/Editor/Windows/Inspector/AssetConfigCommonEditor.cs @@ -31,8 +31,14 @@ public void OnActivation() HeaderIcon = AssetPreview.GetMiniThumbnail(ASConfig); UpdateRecordQueue(); - PackageNames = ACConfig.GetNames() ?? Array.Empty(); - PackageNameIndex = PackageNames.ToList().IndexOf(ABConfig.PackageName); + PackageNames = ACConfig.GetNames() ?? Array.Empty(); + if (PackageNames.Length > 0) + { + PackageNameIndex = PackageNames.ToList().IndexOf(ABConfig.PackageName); + if (PackageNameIndex == -1) PackageNameIndex = 0; + ABConfig.PackageName = PackageNames[PackageNameIndex]; + } + else PackageNameIndex = -1; } public void OnGUI() @@ -467,8 +473,8 @@ private void OnGUIRemote() AssetSystem.SequenceRecordQueue.GET_REMOTE_PATH(ASConfig)); if (GELayout.Button("Upload FTP", GSValue)) - AHandle.FTP.Create("", "", "") - .UploadFile( + AHandle.FTP.Create("", "", ""). + UploadFile( AssetSystem.SequenceRecordQueue.LOCAL_PATH); } } @@ -576,4 +582,4 @@ private void Update() #endregion } -} +} \ No newline at end of file diff --git a/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Load.Asset.cs b/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Load.Asset.cs index 116908c..a05cdf6 100644 --- a/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Load.Asset.cs +++ b/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Load.Asset.cs @@ -79,19 +79,21 @@ protected override IEnumerator CreateCoroutine() private TaskAwaiter AwaiterGeneric; + private AssetOperationHandle Operation; + private async Task GetTask() { - var operation = Instance.HandleGet(Address); - if (operation is null) + Operation = Instance.HandleGet(Address); + if (Operation is null) { var package = await Instance.AutoGetPackageTask(Address); if (package is null) return null; - operation = package.LoadAssetAsync(Address, AssetType); - if (!await operation.CheckTask()) return null; - Instance.HandleAdd(Address, operation); + Operation = package.LoadAssetAsync(Address, AssetType); + if (!await Operation.CheckTask()) return null; + Instance.HandleAdd(Address, Operation); } - return operation?.GetAssetObject(); + return Operation?.GetAssetObject(); } protected override TaskAwaiter CreateAsync() @@ -105,8 +107,7 @@ protected override TaskAwaiter CreateAsync() } /// - public override ILoaderHandle LoadAssetAsync(string location, Type type, Action completed = null) => - new LoadAsset(location, type, completed); + public override ILoaderHandle LoadAssetAsync(string location, Type type, Action completed = null) => new LoadAsset(location, type, completed); } } diff --git a/Runtime/Config/ASConfig.cs b/Runtime/Config/ASConfig.cs index 8f0efef..a2035d2 100644 --- a/Runtime/Config/ASConfig.cs +++ b/Runtime/Config/ASConfig.cs @@ -15,6 +15,11 @@ namespace AIO.UEngine { [Description("资源系统配置"), Serializable] [HelpURL("https://github.com/AIO-GAME/Unity.Asset.CLI/blob/main/.github/API_USAGE/Config.md#-aiouengineasconfig---%E8%B5%84%E6%BA%90%E7%B3%BB%E7%BB%9F%E9%85%8D%E7%BD%AE-")] +#if UNITY_2021_1_OR_NEWER + [Icon("Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] +#else + [ScriptIcon(IconRelative = "Packages/com.aio.cli.asset/Resources/Editor/Icon/pencils.png")] +#endif public class ASConfig : ScriptableObject { /// diff --git a/Runtime/Config/ASConfig.cs.meta b/Runtime/Config/ASConfig.cs.meta index 9ba01a1..b23c1a0 100644 --- a/Runtime/Config/ASConfig.cs.meta +++ b/Runtime/Config/ASConfig.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: e64cbe7e677953f4b9cb7965c538c9b2, type: 3} + icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: From 266cc5928ed511fd463381622862b5e7b7fa7997 Mon Sep 17 00:00:00 2001 From: Star fire Date: Fri, 13 Dec 2024 10:45:02 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E7=89=88=E6=9C=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1.5.7/Handle/Action.UpdatePackages.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Action.UpdatePackages.cs b/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Action.UpdatePackages.cs index 054b32c..d9be789 100644 --- a/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Action.UpdatePackages.cs +++ b/Extensions/YooAsset.CLI/Runtime/1.5.7/Handle/Action.UpdatePackages.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using System.Text; using System.Threading.Tasks; using UnityEngine.Networking; @@ -12,10 +13,7 @@ namespace AIO.UEngine.YooAsset partial class Proxy { /// - public override IOperationAction UpdatePackagesTask(ASConfig config, Action completed = null) - { - return new ActionUpdatePackages(config, completed); - } + public override IOperationAction UpdatePackagesTask(ASConfig config, Action completed = null) { return new ActionUpdatePackages(config, completed); } private static bool CheckPackages(string remote, string content, out AssetsPackageConfig[] packages) { @@ -63,8 +61,7 @@ private static bool CheckPackages(string remote, string content, out AssetsPacka return true; } - private static string GetPackageManifestVersionUrl(ASConfig config, AssetsPackageConfig item) => - $"{config.URL}/{AssetSystem.PlatformNameStr}/{item.Name}/{item.Version}/PackageManifest_{item.Name}.version?t={DateTime.Now.Ticks}"; + private static string GetPackageManifestVersionUrl(ASConfig config, AssetsPackageConfig item) => $"{config.URL}/{AssetSystem.PlatformNameStr}/{item.Name}/{item.Version}/PackageManifest_{item.Name}.version?t={DateTime.Now.Ticks}"; /// /// 更新资源包列表 @@ -81,7 +78,7 @@ private static bool UpdatePackagesRemoteSync(ASConfig config) string content; try { - content = AHelper.HTTP.Get(remote); + content = AHelper.HTTP.Get(remote, Encoding.UTF8); } catch (Exception) { @@ -96,7 +93,7 @@ private static bool UpdatePackagesRemoteSync(ASConfig config) item.IsLatest = item.Version == "Latest"; // 如果使用Latest则认为是最新版本 同时需要获取最新版本号 if (!item.IsLatest) continue; var url = GetPackageManifestVersionUrl(config, item); - var temp = AHelper.HTTP.Get(url); + var temp = AHelper.HTTP.Get(url, Encoding.UTF8); if (string.IsNullOrEmpty(temp)) { AssetSystem.LogError($"{url} Request failed"); @@ -127,7 +124,7 @@ private static async Task UpdatePackagesRemoteTask(ASConfig config) string content; try { - content = await AHelper.HTTP.GetAsync(remote); + content = await AHelper.HTTP.GetAsync(remote, Encoding.UTF8); } catch (Exception e) { @@ -143,7 +140,7 @@ private static async Task UpdatePackagesRemoteTask(ASConfig config) item.IsLatest = item.Version == "Latest"; // 如果使用Latest则认为是最新版本 同时需要获取最新版本号 if (!item.IsLatest) continue; var url = GetPackageManifestVersionUrl(config, item); - var temp = await AHelper.HTTP.GetAsync(url); + var temp = await AHelper.HTTP.GetAsync(url, Encoding.UTF8); if (string.IsNullOrEmpty(temp)) { AssetSystem.LogError($"{url} Request failed"); From d732ebfffce84b0e8b912a5bfb805826a2abc229 Mon Sep 17 00:00:00 2001 From: Star fire Date: Fri, 13 Dec 2024 10:46:27 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E2=9C=A8=20up=20version=201.x=20->=201.1?= =?UTF-8?q?.17-preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 12e66de..a07123e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.aio.cli.asset", "displayName": "AIO Unity CLI Asset", "description": "unity3d resources management system.", - "version": "1.1.16-preview", + "version": "1.1.17-preview", "unity": "2019.4", "category": "Runtime", "unityRelease": "0f1", @@ -15,7 +15,7 @@ "url": "https://github.com/AIO-GAME/Unity.Asset.CLI.git" }, "relatedPackages": { - "com.aio.package": "1.0.50-preview", + "com.aio.package": "1.0.51-preview", "com.aio.runner": "1.0.2-preview" }, "keywords": [