Class BaseTypeRequiredAttribute
When applied to a target attribute, specifies a requirement for any type marked
with the target attribute to implement or inherit specific type or types.
Inheritance
BaseTypeRequiredAttribute
Assembly: UnityEngine.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
[BaseTypeRequired(typeof(Attribute))]
public sealed class BaseTypeRequiredAttribute : Attribute, _Attribute
Examples
[BaseTypeRequired(typeof(IComponent)] // Specify requirement
public class ComponentAttribute : Attribute { }
[Component] // ComponentAttribute requires implementing IComponent interface
public class MyComponent : IComponent { }
Constructors
|
Improve this Doc
View Source
BaseTypeRequiredAttribute(Type)
Declaration
public BaseTypeRequiredAttribute(Type baseType)
Parameters
Type |
Name |
Description |
Type |
baseType |
|
Properties
|
Improve this Doc
View Source
BaseType
Declaration
public Type BaseType { get; }
Property Value
Implements
Extension Methods