这样的事可能吗?如果不清楚我在说什么,这里有一个详细的例子:
以我几周前编写的这个快速实用程序类(详细信息省略)以及我想分享的示例为例:
public abstract class CommonOdinAttributesForOwnedType<TProperty, TParent> : OdinAttributeProcessor<TProperty>
{
//snip
}
//EXAMPLE IMPLEMENTATION (Recommended to be nested inside MyBaseType):
protected class BoolAttributesInsideMyBaseType : CommonOdinAttributesForOwnedType<bool, MyBaseType>
{
protected override List<Attribute> GetAdditionalAttributes()
{
return new List<Attribute>()
{
new ToggleLeftAttribute(), //add more desired attributes here
};
}
}
Run Code Online (Sandbox Code Playgroud)
我在抽象类上方有以下 XML:
/// <summary>
/// Gives ALL objects of type TProperty drawn within classes derived from TParent a requested list of
/// Odin GUI attributes
/// <code>
/// //EXAMPLE IMPLEMENTATION (Recommended to be nested …Run Code Online (Sandbox Code Playgroud)