From 2dd3ba847e22aad4516c3e07f6e78b1275b16a00 Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 21 May 2022 22:24:05 +0800 Subject: [PATCH] Bundle build system adds builtin files copy options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 资源构建增加内置文件拷贝的选项 --- .../AssetBundleBuilderSetting.cs | 7 ++++- .../AssetBundleBuilderWindow.cs | 30 +++++++++++++------ .../AssetBundleBuilderWindow.uxml | 1 + .../AssetBundleBuilder/BuildParameters.cs | 9 ++++-- .../BuildReport/ReportSummary.cs | 5 ++++ .../BuildTasks/TaskCopyBuildinFiles.cs | 2 +- .../BuildTasks/TaskCreatePatchManifest.cs | 4 +-- .../BuildTasks/TaskCreateReport.cs | 1 + .../VisualViewers/ReporterSummaryViewer.cs | 1 + 9 files changed, 44 insertions(+), 16 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderSetting.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderSetting.cs index 47593da..9c5ad25 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderSetting.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderSetting.cs @@ -16,7 +16,7 @@ namespace YooAsset.Editor public EBuildMode BuildMode = EBuildMode.ForceRebuild; /// - /// 内置资源标签 + /// 内置资源标签(首包资源标签) /// public string BuildTags = string.Empty; @@ -34,5 +34,10 @@ namespace YooAsset.Editor /// 附加后缀格式 /// public bool AppendExtension = false; + + /// + /// 拷贝内置资源文件(首包资源文件) + /// + public bool CopyBuildinTagFiles = true; } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs index eade0ec..a594dbb 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs @@ -25,11 +25,12 @@ namespace YooAsset.Editor private TextField _buildOutputField; private IntegerField _buildVersionField; private EnumField _buildModeField; - private TextField _buildTagsField; + private TextField _buildinTagsField; private PopupField _encryptionField; private EnumField _compressionField; private Toggle _appendExtensionToggle; - + private Toggle _copyBuildinTagFilesToggle; + public void CreateGUI() { try @@ -76,11 +77,11 @@ namespace YooAsset.Editor }); // 内置资源标签 - _buildTagsField = root.Q("BuildinTags"); - _buildTagsField.SetValueWithoutNotify(AssetBundleBuilderSettingData.Setting.BuildTags); - _buildTagsField.RegisterValueChangedCallback(evt => + _buildinTagsField = root.Q("BuildinTags"); + _buildinTagsField.SetValueWithoutNotify(AssetBundleBuilderSettingData.Setting.BuildTags); + _buildinTagsField.RegisterValueChangedCallback(evt => { - AssetBundleBuilderSettingData.Setting.BuildTags = _buildTagsField.value; + AssetBundleBuilderSettingData.Setting.BuildTags = _buildinTagsField.value; }); // 加密方法 @@ -123,6 +124,14 @@ namespace YooAsset.Editor AssetBundleBuilderSettingData.Setting.AppendExtension = _appendExtensionToggle.value; }); + // 拷贝首包文件 + _copyBuildinTagFilesToggle = root.Q("CopyBuildinFiles"); + _copyBuildinTagFilesToggle.SetValueWithoutNotify(AssetBundleBuilderSettingData.Setting.CopyBuildinTagFiles); + _copyBuildinTagFilesToggle.RegisterValueChangedCallback(evt => + { + AssetBundleBuilderSettingData.Setting.CopyBuildinTagFiles = _copyBuildinTagFilesToggle.value; + }); + // 构建按钮 var buildButton = root.Q