重构了资源构建页面,方便扩展自定义界面。
This commit is contained in:
何冠峰
2025-06-17 15:29:54 +08:00
parent 06a50a049e
commit 3949abb53f
33 changed files with 814 additions and 498 deletions

View File

@@ -265,7 +265,7 @@ namespace YooAsset.Editor
}
private static string GetRuleDisplayName(string name, Type type)
{
var attribute = DisplayNameAttributeHelper.GetAttribute<DisplayNameAttribute>(type);
var attribute = EditorTools.GetAttribute<DisplayNameAttribute>(type);
if (attribute != null && string.IsNullOrEmpty(attribute.DisplayName) == false)
return attribute.DisplayName;
else

View File

@@ -1,5 +1,4 @@
using System;
using System.Reflection;
namespace YooAsset.Editor
{
@@ -15,22 +14,4 @@ namespace YooAsset.Editor
this.DisplayName = name;
}
}
public static class DisplayNameAttributeHelper
{
internal static T GetAttribute<T>(Type type) where T : Attribute
{
return (T)type.GetCustomAttribute(typeof(T), false);
}
internal static T GetAttribute<T>(MethodInfo methodInfo) where T : Attribute
{
return (T)methodInfo.GetCustomAttribute(typeof(T), false);
}
internal static T GetAttribute<T>(FieldInfo field) where T : Attribute
{
return (T)field.GetCustomAttribute(typeof(T), false);
}
}
}