From 0844447b46b89b2eb7135abb9f3d45cc8f4eb2f6 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 3 Nov 2022 10:15:27 +0800 Subject: [PATCH] Update AssetBundleBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 界面增加构建版本选项 --- .../AssetBundleBuilder/AssetBundleBuilderWindow.cs | 11 +++++++++-- .../AssetBundleBuilder/AssetBundleBuilderWindow.uxml | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs index 55bf293..2d854ac 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs @@ -27,6 +27,7 @@ namespace YooAsset.Editor private TextField _buildOutputField; private EnumField _buildPipelineField; private EnumField _buildModeField; + private TextField _buildVersionField; private PopupField _buildPackageField; private PopupField _encryptionField; private EnumField _compressionField; @@ -91,6 +92,10 @@ namespace YooAsset.Editor RefreshWindow(); }); + // 构建版本 + _buildVersionField = root.Q("BuildVersion"); + _buildVersionField.SetValueWithoutNotify(GetBuildPackageVersion()); + // 构建包裹 var buildPackageContainer = root.Q("BuildPackageContainer"); if (_buildPackageNames.Count > 0) @@ -256,7 +261,7 @@ namespace YooAsset.Editor buildParameters.BuildPipeline = AssetBundleBuilderSettingData.Setting.BuildPipeline; buildParameters.BuildMode = AssetBundleBuilderSettingData.Setting.BuildMode; buildParameters.PackageName = AssetBundleBuilderSettingData.Setting.BuildPackage; - buildParameters.PackageVersion = GetDefaultPackageVersion(); + buildParameters.PackageVersion = _buildVersionField.value; buildParameters.VerifyBuildingResult = true; buildParameters.EncryptionServices = CreateEncryptionServicesInstance(); buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption; @@ -277,7 +282,9 @@ namespace YooAsset.Editor EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory); } } - private string GetDefaultPackageVersion() + + // 构建版本相关 + private string GetBuildPackageVersion() { int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute; return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.uxml b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.uxml index c8d1cd0..0585cfc 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.uxml +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.uxml @@ -6,6 +6,7 @@ +