Odin Attributes 为Unity开发者提供了更多的自定义选项,使得开发过程更加高效和愉悦。通过使用这些特性,开发者可以创建更加专业和用户友好的编辑器界面,从而提升整个开发团队的工作效率。
Type Drawer Settings 特性用于为 Type Drawer 提供选项。
[ShowInInspector]
public Type Default;
[Title("Base Type"), ShowInInspector, LabelText("Set")]
[TypeDrawerSettings(BaseType = typeof(IEnumerable<>))]
public Type BaseType_Set;
[ShowInInspector, LabelText("Not Set")]
[TypeDrawerSettings(BaseType = null)]
public Type BaseType_NotSet;
[Title(nameof(TypeDrawerSettingsAttribute.Filter)), ShowInInspector, LabelText("Concrete Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes)]
public Type Filter_Default;
[ShowInInspector, LabelText("Concrete- && Generic Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes | TypeInclusionFilter.IncludeGenerics)]
public Type Filter_Generics;
[ShowInInspector, LabelText("Concrete- && Interface Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes | TypeInclusionFilter.IncludeInterfaces)]
public Type Filter_Interfaces;
[ShowInInspector, LabelText("Concrete- && Abstract Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes | TypeInclusionFilter.IncludeAbstracts)]
public Type Filter_Abstracts;
[ShowInInspector, LabelText("Concrete-, Abstract- && Generic Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes |
TypeInclusionFilter.IncludeAbstracts |
TypeInclusionFilter.IncludeGenerics)]
public Type Filter_Abstracts_Generics;
[ShowInInspector, LabelText("Concrete-, Interface- && Generic Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes |
TypeInclusionFilter.IncludeInterfaces |
TypeInclusionFilter.IncludeGenerics)]
public Type Filter_Interfaces_Generics;
[ShowInInspector, LabelText("Concrete-, Interface- && Abstract Types")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeConcreteTypes |
TypeInclusionFilter.IncludeInterfaces |
TypeInclusionFilter.IncludeAbstracts)]
public Type Filter_Interfaces_Abstracts;
[ShowInInspector, LabelText("All")]
[TypeDrawerSettings(BaseType = typeof(IBaseGeneric<>), Filter = TypeInclusionFilter.IncludeAll)]
public Type Filter_All;
public interface IBaseGeneric<T> { }
public interface IBase : IBaseGeneric<int> { }
public abstract class Base : IBase { }
public class Concrete : Base { }
public class ConcreteGeneric<T> : Base { }
public abstract class BaseGeneric<T> : IBase { }
[CompilerGenerated]
public class ConcreteGenerated : Base { }