From 83164dfbe96560b061101eab52bcd9fc6b4a8f0e Mon Sep 17 00:00:00 2001 From: hevinci Date: Sun, 25 Jun 2023 15:58:08 +0800 Subject: [PATCH] update AssetBundleBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 资源包构建流程可扩展支持 --- .../AssetBundleBuilder/AssetBundleBuilder.cs | 134 ++++++++++++------ .../BuildSystem/BuildRunner.cs | 4 +- .../BuildSystem/ETaskPipeline.cs | 22 +++ .../BuildSystem/ETaskPipeline.cs.meta | 11 ++ .../BuildSystem/TaskAttribute.cs | 25 +++- .../BuildTasks/TaskBuilding.cs | 2 +- .../BuildTasks/TaskBuilding_SBP.cs | 2 +- .../BuildTasks/TaskCopyBuildinFiles.cs | 4 +- .../BuildTasks/TaskCopyRawFile.cs | 2 +- .../BuildTasks/TaskCreateManifest.cs | 2 +- .../BuildTasks/TaskCreatePackage.cs | 2 +- .../BuildTasks/TaskCreateReport.cs | 2 +- .../BuildTasks/TaskEncryption.cs | 2 +- .../BuildTasks/TaskGetBuildMap.cs | 2 +- .../BuildTasks/TaskPrepare.cs | 2 +- .../BuildTasks/TaskUpdateBundleInfo.cs | 2 +- .../BuildTasks/TaskVerifyBuildResult.cs | 2 +- .../BuildTasks/TaskVerifyBuildResult_SBP.cs | 2 +- Assets/YooAsset/Editor/EditorTools.cs | 39 ++++- 19 files changed, 197 insertions(+), 66 deletions(-) create mode 100644 Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs create mode 100644 Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs.meta diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs index 9813d7f..7d7a348 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs @@ -1,6 +1,8 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Reflection; +using System.Linq; using UnityEngine; using UnityEditor; @@ -39,51 +41,11 @@ namespace YooAsset.Editor var buildParametersContext = new BuildParametersContext(buildParameters); _buildContext.SetContextObject(buildParametersContext); - // 创建构建节点 - List pipeline; - if (buildParameters.BuildPipeline == EBuildPipeline.BuiltinBuildPipeline) - { - pipeline = new List - { - new TaskPrepare(), //前期准备工作 - new TaskGetBuildMap(), //获取构建列表 - new TaskBuilding(), //开始执行构建 - new TaskCopyRawFile(), //拷贝原生文件 - new TaskVerifyBuildResult(), //验证构建结果 - new TaskEncryption(), //加密资源文件 - new TaskUpdateBundleInfo(), //更新资源包信息 - new TaskCreateManifest(), //创建清单文件 - new TaskCreateReport(), //创建报告文件 - new TaskCreatePackage(), //制作包裹 - new TaskCopyBuildinFiles(), //拷贝内置文件 - }; - } - else if (buildParameters.BuildPipeline == EBuildPipeline.ScriptableBuildPipeline) - { - pipeline = new List - { - new TaskPrepare(), //前期准备工作 - new TaskGetBuildMap(), //获取构建列表 - new TaskBuilding_SBP(), //开始执行构建 - new TaskCopyRawFile(), //拷贝原生文件 - new TaskVerifyBuildResult_SBP(), //验证构建结果 - new TaskEncryption(), //加密资源文件 - new TaskUpdateBundleInfo(), //更新补丁信息 - new TaskCreateManifest(), //创建清单文件 - new TaskCreateReport(), //创建报告文件 - new TaskCreatePackage(), //制作补丁包 - new TaskCopyBuildinFiles(), //拷贝内置文件 - }; - } - else - { - throw new NotImplementedException(); - } - // 初始化日志 BuildLogger.InitLogger(buildParameters.EnableLog); // 执行构建流程 + var pipeline = GetBuildTasks(buildParameters.BuildPipeline); var buildResult = BuildRunner.Run(pipeline, _buildContext); if (buildResult.Success) { @@ -99,5 +61,95 @@ namespace YooAsset.Editor return buildResult; } + + private List GetBuildTasks(EBuildPipeline buildPipeline) + { + // 获取任务节点的属性集合 + List attrList = new List(); + if (buildPipeline == EBuildPipeline.BuiltinBuildPipeline) + { + /* + List pipeline = new List + { + new TaskPrepare(), //前期准备工作 + new TaskGetBuildMap(), //获取构建列表 + new TaskBuilding(), //开始执行构建 + new TaskCopyRawFile(), //拷贝原生文件 + new TaskVerifyBuildResult(), //验证构建结果 + new TaskEncryption(), //加密资源文件 + new TaskUpdateBundleInfo(), //更新资源包信息 + new TaskCreateManifest(), //创建清单文件 + new TaskCreateReport(), //创建报告文件 + new TaskCreatePackage(), //制作包裹 + new TaskCopyBuildinFiles(), //拷贝内置文件 + }; + */ + + var classTypes = EditorTools.GetAssignableTypes(typeof(IBuildTask)); + foreach (var classType in classTypes) + { + var attribute = classType.GetCustomAttribute(); + if (attribute == null) + throw new Exception($"Not found {nameof(TaskAttribute)} int type : {classType.FullName}"); + + attribute.ClassType = classType; + if (attribute.Pipeline == ETaskPipeline.AllPipeline || attribute.Pipeline == ETaskPipeline.BuiltinBuildPipeline) + attrList.Add(attribute); + } + } + else if (buildPipeline == EBuildPipeline.ScriptableBuildPipeline) + { + /* + List pipeline = new List + { + new TaskPrepare(), //前期准备工作 + new TaskGetBuildMap(), //获取构建列表 + new TaskBuilding_SBP(), //开始执行构建 + new TaskCopyRawFile(), //拷贝原生文件 + new TaskVerifyBuildResult_SBP(), //验证构建结果 + new TaskEncryption(), //加密资源文件 + new TaskUpdateBundleInfo(), //更新补丁信息 + new TaskCreateManifest(), //创建清单文件 + new TaskCreateReport(), //创建报告文件 + new TaskCreatePackage(), //制作补丁包 + new TaskCopyBuildinFiles(), //拷贝内置文件 + }; + */ + + var classTypes = EditorTools.GetAssignableTypes(typeof(IBuildTask)); + foreach (var classType in classTypes) + { + var attribute = classType.GetCustomAttribute(); + if (attribute == null) + throw new Exception($"Not found {nameof(TaskAttribute)} int type : {classType.FullName}"); + + attribute.ClassType = classType; + if (attribute.Pipeline == ETaskPipeline.AllPipeline || attribute.Pipeline == ETaskPipeline.ScriptableBuildPipeline) + attrList.Add(attribute); + } + } + else + { + throw new NotImplementedException(); + } + + // 对任务节点进行排序 + attrList.Sort((a, b) => + { + if (a.TaskOrder > b.TaskOrder) { return 1; } + else if (a.TaskOrder < b.TaskOrder) { return -1; } + else { return 0; } + }); + + // 创建任务节点实例 + List pipeline = new List(attrList.Count); + foreach (var taskAttr in attrList) + { + var task = Activator.CreateInstance(taskAttr.ClassType) as IBuildTask; + pipeline.Add(task); + } + + return pipeline; + } } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs index bab28d9..7943ad6 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs @@ -38,7 +38,7 @@ namespace YooAsset.Editor _buildWatch = Stopwatch.StartNew(); var taskAttribute = task.GetType().GetCustomAttribute(); if (taskAttribute != null) - BuildLogger.Log($"---------------------------------------->{taskAttribute.Desc}<---------------------------------------"); + BuildLogger.Log($"---------------------------------------->{taskAttribute.TaskDesc}<---------------------------------------"); task.Run(context); _buildWatch.Stop(); @@ -46,7 +46,7 @@ namespace YooAsset.Editor int seconds = GetBuildSeconds(); TotalSeconds += seconds; if (taskAttribute != null) - BuildLogger.Log($"{taskAttribute.Desc}耗时:{seconds}秒"); + BuildLogger.Log($"{taskAttribute.TaskDesc}耗时:{seconds}秒"); } catch (Exception e) { diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs new file mode 100644 index 0000000..f90df01 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs @@ -0,0 +1,22 @@ +using System; + +namespace YooAsset.Editor +{ + public enum ETaskPipeline + { + /// + /// 所有的构建管线 + /// + AllPipeline, + + /// + /// 内置构建管线 + /// + BuiltinBuildPipeline, + + /// + /// 可编程构建管线 + /// + ScriptableBuildPipeline, + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs.meta b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs.meta new file mode 100644 index 0000000..ccabb5f --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/ETaskPipeline.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32477ef3a448a9144aa1574a052fe54e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/TaskAttribute.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/TaskAttribute.cs index 629385f..1b970d4 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/TaskAttribute.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/TaskAttribute.cs @@ -5,10 +5,29 @@ namespace YooAsset.Editor [AttributeUsage(AttributeTargets.Class)] public class TaskAttribute : Attribute { - public string Desc; - public TaskAttribute(string desc) + /// + /// 任务所属的构建流水线 + /// + public ETaskPipeline Pipeline; + + /// + /// 执行顺序 + /// + public int TaskOrder; + + /// + /// 任务说明 + /// + public string TaskDesc; + + // 关联的任务类 + public Type ClassType { set; get; } + + public TaskAttribute(ETaskPipeline pipeline, int taskOrder, string taskDesc) { - Desc = desc; + Pipeline = pipeline; + TaskOrder = taskOrder; + TaskDesc = taskDesc; } } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs index da267bd..fdf7248 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs @@ -7,7 +7,7 @@ using UnityEngine; namespace YooAsset.Editor { - [TaskAttribute("资源构建内容打包")] + [TaskAttribute(ETaskPipeline.BuiltinBuildPipeline, 300, "资源构建内容打包")] public class TaskBuilding : IBuildTask { public class BuildResultContext : IContextObject diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs index bb69ae2..4947601 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs @@ -9,7 +9,7 @@ using UnityEditor.Build.Pipeline.Tasks; namespace YooAsset.Editor { - [TaskAttribute("资源构建内容打包")] + [TaskAttribute(ETaskPipeline.ScriptableBuildPipeline, 300, "资源构建内容打包")] public class TaskBuilding_SBP : IBuildTask { public class BuildResultContext : IContextObject diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs index fcb8a38..3b54adb 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs @@ -6,7 +6,7 @@ using UnityEngine; namespace YooAsset.Editor { - [TaskAttribute("拷贝内置文件到流目录")] + [TaskAttribute(ETaskPipeline.AllPipeline, 1100, "拷贝内置文件到流目录")] public class TaskCopyBuildinFiles : IBuildTask { void IBuildTask.Run(BuildContext context) @@ -69,7 +69,7 @@ namespace YooAsset.Editor // 拷贝文件列表(所有文件) if (option == ECopyBuildinFileOption.ClearAndCopyAll || option == ECopyBuildinFileOption.OnlyCopyAll) - { + { foreach (var packageBundle in manifest.BundleList) { string sourcePath = $"{packageOutputDirectory}/{packageBundle.FileName}"; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyRawFile.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyRawFile.cs index 661af52..1922176 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyRawFile.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyRawFile.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; namespace YooAsset.Editor { - [TaskAttribute("拷贝原生文件")] + [TaskAttribute(ETaskPipeline.AllPipeline, 400, "拷贝原生文件")] public class TaskCopyRawFile : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateManifest.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateManifest.cs index b6d62e8..ec7c193 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateManifest.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateManifest.cs @@ -13,7 +13,7 @@ namespace YooAsset.Editor internal PackageManifest Manifest; } - [TaskAttribute("创建清单文件")] + [TaskAttribute(ETaskPipeline.AllPipeline, 800, "创建清单文件")] public class TaskCreateManifest : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePackage.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePackage.cs index 4f891bb..6d43997 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePackage.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePackage.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace YooAsset.Editor { - [TaskAttribute("制作包裹")] + [TaskAttribute(ETaskPipeline.AllPipeline, 1000, "制作包裹")] public class TaskCreatePackage : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs index 1ca62f0..600fa1f 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs @@ -6,7 +6,7 @@ using UnityEditor; namespace YooAsset.Editor { - [TaskAttribute("创建构建报告文件")] + [TaskAttribute(ETaskPipeline.AllPipeline, 900, "创建构建报告文件")] public class TaskCreateReport : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs index 4ca3832..c0a2c76 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace YooAsset.Editor { - [TaskAttribute("资源包加密")] + [TaskAttribute(ETaskPipeline.AllPipeline, 600, "资源包加密")] public class TaskEncryption : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs index 59876f9..31b01da 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs @@ -7,7 +7,7 @@ using UnityEditor; namespace YooAsset.Editor { - [TaskAttribute("获取资源构建内容")] + [TaskAttribute(ETaskPipeline.AllPipeline, 200, "获取资源构建内容")] public class TaskGetBuildMap : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs index 5a824d5..b8ed010 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs @@ -6,7 +6,7 @@ using UnityEditor; namespace YooAsset.Editor { - [TaskAttribute("资源构建准备工作")] + [TaskAttribute(ETaskPipeline.AllPipeline, 100, "资源构建准备工作")] public class TaskPrepare : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskUpdateBundleInfo.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskUpdateBundleInfo.cs index 4881a51..75976b0 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskUpdateBundleInfo.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskUpdateBundleInfo.cs @@ -6,7 +6,7 @@ using UnityEditor; namespace YooAsset.Editor { - [TaskAttribute("更新资源包信息")] + [TaskAttribute(ETaskPipeline.AllPipeline, 700, "更新资源包信息")] public class TaskUpdateBundleInfo : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs index e3ffbbf..f113e4a 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs @@ -8,7 +8,7 @@ using UnityEngine; namespace YooAsset.Editor { - [TaskAttribute("验证构建结果")] + [TaskAttribute(ETaskPipeline.BuiltinBuildPipeline, 500, "验证构建结果")] public class TaskVerifyBuildResult : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult_SBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult_SBP.cs index b4ec42a..33c8ff2 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult_SBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult_SBP.cs @@ -9,7 +9,7 @@ using UnityEditor.Build.Pipeline.Interfaces; namespace YooAsset.Editor { - [TaskAttribute("验证构建结果")] + [TaskAttribute(ETaskPipeline.ScriptableBuildPipeline, 500, "验证构建结果")] public class TaskVerifyBuildResult_SBP : IBuildTask { void IBuildTask.Run(BuildContext context) diff --git a/Assets/YooAsset/Editor/EditorTools.cs b/Assets/YooAsset/Editor/EditorTools.cs index 9cc3c2d..cb5f061 100644 --- a/Assets/YooAsset/Editor/EditorTools.cs +++ b/Assets/YooAsset/Editor/EditorTools.cs @@ -35,10 +35,20 @@ namespace YooAsset.Editor TypeCache.TypeCollection collection = TypeCache.GetTypesDerivedFrom(parentType); return collection.ToList(); } + + /// + /// 获取带有指定属性的所有类的类型 + /// + public static List GetTypesWithAttribute(System.Type attrType) + { + TypeCache.TypeCollection collection = TypeCache.GetTypesWithAttribute(attrType); + return collection.ToList(); + } #else private static readonly List _cacheTypes = new List(10000); private static void InitAssembly() { + _cacheTypes.Clear(); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { @@ -65,6 +75,23 @@ namespace YooAsset.Editor } return result; } + + /// + /// 获取带有指定属性的所有类的类型 + /// + public static List GetTypesWithAttribute(System.Type attrType) + { + List result = new List(); + for (int i = 0; i < _cacheTypes.Count; i++) + { + Type type = _cacheTypes[i]; + if (type.GetCustomAttribute(attrType) != null) + { + result.Add(type); + } + } + return result; + } #endif /// @@ -213,11 +240,11 @@ namespace YooAsset.Editor public static void FocusUnitySceneWindow() { EditorWindow.FocusWindowIfItsOpen(); - } - public static void CloseUnityGameWindow() - { - System.Type T = Assembly.Load("UnityEditor").GetType("UnityEditor.GameView"); - EditorWindow.GetWindow(T, false, "GameView", true).Close(); + } + public static void CloseUnityGameWindow() + { + System.Type T = Assembly.Load("UnityEditor").GetType("UnityEditor.GameView"); + EditorWindow.GetWindow(T, false, "GameView", true).Close(); } public static void FocusUnityGameWindow() { @@ -399,7 +426,7 @@ namespace YooAsset.Editor FileInfo fileInfo = new FileInfo(filePath); fileInfo.MoveTo(destPath); } - + /// /// 拷贝文件夹 /// 注意:包括所有子目录的文件