update asset bundle builder

pull/418/head
何冠峰 2024-12-19 12:24:19 +08:00
parent f9074518dd
commit 429f68ff64
2 changed files with 28 additions and 0 deletions

View File

@ -13,6 +13,7 @@ namespace YooAsset.Editor
internal abstract class BuildPipelineViewerBase internal abstract class BuildPipelineViewerBase
{ {
private const int StyleWidth = 400; private const int StyleWidth = 400;
private const int LabelMinWidth = 180;
protected readonly string PackageName; protected readonly string PackageName;
protected readonly BuildTarget BuildTarget; protected readonly BuildTarget BuildTarget;
@ -150,6 +151,17 @@ namespace YooAsset.Editor
AssetBundleBuilderSetting.SetPackageUseAssetDependencyDB(PackageName, BuildPipeline, _useAssetDependencyDBToggle.value); AssetBundleBuilderSetting.SetPackageUseAssetDependencyDB(PackageName, BuildPipeline, _useAssetDependencyDBToggle.value);
}); });
// 对齐文本间距
UIElementsTools.SetElementLabelMinWidth(_buildOutputField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_buildVersionField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_compressionField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_encryptionField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_outputNameStyleField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_copyBuildinFileOptionField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_copyBuildinFileTagsField, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_clearBuildCacheToggle, LabelMinWidth);
UIElementsTools.SetElementLabelMinWidth(_useAssetDependencyDBToggle, LabelMinWidth);
// 构建按钮 // 构建按钮
var buildButton = Root.Q<Button>("Build"); var buildButton = Root.Q<Button>("Build");
buildButton.clicked += BuildButton_clicked; buildButton.clicked += BuildButton_clicked;

View File

@ -8,6 +8,9 @@ namespace YooAsset.Editor
{ {
public static class UIElementsTools public static class UIElementsTools
{ {
/// <summary>
/// 设置元素显隐
/// </summary>
public static void SetElementVisible(VisualElement element, bool visible) public static void SetElementVisible(VisualElement element, bool visible)
{ {
if (element == null) if (element == null)
@ -16,6 +19,19 @@ namespace YooAsset.Editor
element.style.display = visible ? DisplayStyle.Flex : DisplayStyle.None; element.style.display = visible ? DisplayStyle.Flex : DisplayStyle.None;
element.style.visibility = visible ? Visibility.Visible : Visibility.Hidden; element.style.visibility = visible ? Visibility.Visible : Visibility.Hidden;
} }
/// <summary>
/// 设置元素的文本最小宽度
/// </summary>
public static void SetElementLabelMinWidth(VisualElement element, int minWidth)
{
var label = element.Q<Label>();
if (label != null)
{
// 设置最小宽度
label.style.minWidth = minWidth;
}
}
} }
} }
#endif #endif