update asset art reporter

This commit is contained in:
何冠峰
2025-01-24 00:43:16 +08:00
parent 57d1e92e59
commit 31a89fa1a3
8 changed files with 185 additions and 56 deletions

View File

@@ -25,7 +25,12 @@ namespace YooAsset.Editor
/// 单元列最大宽度
/// </summary>
public Length MaxWidth = MaxValue;
/// <summary>
/// 文本的锚点类型
/// </summary>
public TextAnchor TxtAnchor = TextAnchor.MiddleLeft;
/// <summary>
/// 可伸缩
/// </summary>

View File

@@ -126,7 +126,7 @@ namespace YooAsset.Editor
toolbarBtn.userData = column;
toolbarBtn.name = column.ElementName;
toolbarBtn.text = column.HeaderTitle;
toolbarBtn.style.unityTextAlign = TextAnchor.MiddleLeft;
toolbarBtn.style.unityTextAlign = column.ColumnStyle.TxtAnchor;
toolbarBtn.style.flexGrow = column.ColumnStyle.Stretchable ? 1f : 0f;
toolbarBtn.style.width = column.ColumnStyle.Width;
toolbarBtn.style.minWidth = column.ColumnStyle.MinWidth;

View File

@@ -41,5 +41,36 @@ namespace YooAsset.Editor
root.Add(spliteView);
}
}
/// <summary>
/// 显示开关(眼睛图标)
/// </summary>
public class DisplayToggle : Toggle
{
private readonly VisualElement _checkbox;
public DisplayToggle()
{
_checkbox = this.Q<VisualElement>("unity-checkmark");
RefreshIcon();
}
/// <summary>
/// 刷新图标
/// </summary>
public void RefreshIcon()
{
if (this.value)
{
var icon = EditorGUIUtility.IconContent("animationvisibilitytoggleoff@2x").image as Texture2D;
_checkbox.style.backgroundImage = icon;
}
else
{
var icon = EditorGUIUtility.IconContent("animationvisibilitytoggleon@2x").image as Texture2D;
_checkbox.style.backgroundImage = icon;
}
}
}
}
#endif

View File

@@ -1,7 +1,6 @@

namespace YooAsset.Editor
{
#if UNITY_2019
public static partial class UnityEngine_UIElements_ListView_Extension
{
@@ -21,5 +20,4 @@ namespace YooAsset.Editor
}
}
#endif
}