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 @@ +