Skip to main content

Class ExtendsAttribute

Namespace: RealityCollective.ServiceFramework.Attributes

Constraint that allows selection of classes that extend a specific class when selecting a SystemType with the Unity inspector.

public sealed class ExtendsAttribute : SystemTypeAttribute

Inheritance​

PropertyAttribute ← SystemTypeAttribute ← ExtendsAttribute

Inherited Members​

SystemTypeAttribute.Grouping, SystemTypeAttribute.AllowAbstract, SystemTypeAttribute.IsConstraintSatisfied(Type)

Constructors​

ExtendsAttribute(Type, TypeGrouping)​

Initializes a new instance of the ExtendsAttribute class.

public ExtendsAttribute(Type baseType, TypeGrouping grouping)

Parameters​

baseType Type

Type of class that selectable classes must derive from.

grouping TypeGrouping

Gets or sets grouping of selectable classes. Defaults to ByNamespaceFlat unless explicitly specified.

Properties​

BaseType​

Gets the type of class that selectable classes must derive from.

public Type BaseType { get; }

Property Value​

Type

Methods​

IsConstraintSatisfied(Type)​

Determines whether the specified Type satisfies filter constraint.

public override bool IsConstraintSatisfied(Type type)

Parameters​

type Type

Type to test.

Returns​

bool

A Boolean value indicating if the type specified by type satisfies this constraint and should thus be selectable.