Update AssetBundleBuilder

界面增加构建版本选项
pull/51/head
hevinci 2022-11-03 10:15:27 +08:00
parent c7116ad165
commit 0844447b46
2 changed files with 10 additions and 2 deletions

View File

@ -27,6 +27,7 @@ namespace YooAsset.Editor
private TextField _buildOutputField; private TextField _buildOutputField;
private EnumField _buildPipelineField; private EnumField _buildPipelineField;
private EnumField _buildModeField; private EnumField _buildModeField;
private TextField _buildVersionField;
private PopupField<string> _buildPackageField; private PopupField<string> _buildPackageField;
private PopupField<string> _encryptionField; private PopupField<string> _encryptionField;
private EnumField _compressionField; private EnumField _compressionField;
@ -91,6 +92,10 @@ namespace YooAsset.Editor
RefreshWindow(); RefreshWindow();
}); });
// 构建版本
_buildVersionField = root.Q<TextField>("BuildVersion");
_buildVersionField.SetValueWithoutNotify(GetBuildPackageVersion());
// 构建包裹 // 构建包裹
var buildPackageContainer = root.Q("BuildPackageContainer"); var buildPackageContainer = root.Q("BuildPackageContainer");
if (_buildPackageNames.Count > 0) if (_buildPackageNames.Count > 0)
@ -256,7 +261,7 @@ namespace YooAsset.Editor
buildParameters.BuildPipeline = AssetBundleBuilderSettingData.Setting.BuildPipeline; buildParameters.BuildPipeline = AssetBundleBuilderSettingData.Setting.BuildPipeline;
buildParameters.BuildMode = AssetBundleBuilderSettingData.Setting.BuildMode; buildParameters.BuildMode = AssetBundleBuilderSettingData.Setting.BuildMode;
buildParameters.PackageName = AssetBundleBuilderSettingData.Setting.BuildPackage; buildParameters.PackageName = AssetBundleBuilderSettingData.Setting.BuildPackage;
buildParameters.PackageVersion = GetDefaultPackageVersion(); buildParameters.PackageVersion = _buildVersionField.value;
buildParameters.VerifyBuildingResult = true; buildParameters.VerifyBuildingResult = true;
buildParameters.EncryptionServices = CreateEncryptionServicesInstance(); buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption; buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
@ -277,7 +282,9 @@ namespace YooAsset.Editor
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory); EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
} }
} }
private string GetDefaultPackageVersion()
// 构建版本相关
private string GetBuildPackageVersion()
{ {
int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute; int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute;
return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes; return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes;

View File

@ -6,6 +6,7 @@
<ui:TextField picking-mode="Ignore" label="Build Output" name="BuildOutput" /> <ui:TextField picking-mode="Ignore" label="Build Output" name="BuildOutput" />
<uie:EnumField label="Build Pipeline" name="BuildPipeline" /> <uie:EnumField label="Build Pipeline" name="BuildPipeline" />
<uie:EnumField label="Build Mode" name="BuildMode" /> <uie:EnumField label="Build Mode" name="BuildMode" />
<ui:TextField picking-mode="Ignore" label="Build Version" name="BuildVersion" style="width: 350px;" />
<ui:VisualElement name="BuildPackageContainer" style="height: 24px;" /> <ui:VisualElement name="BuildPackageContainer" style="height: 24px;" />
<ui:VisualElement name="EncryptionContainer" style="height: 24px;" /> <ui:VisualElement name="EncryptionContainer" style="height: 24px;" />
<uie:EnumField label="Compression" value="Center" name="Compression" /> <uie:EnumField label="Compression" value="Center" name="Compression" />