Skip to main content

Class ImplementsAttribute

Namespace: RealityCollective.ServiceFramework.Attributes

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

public sealed class ImplementsAttribute : SystemTypeAttribute

Inheritance​

PropertyAttribute ← SystemTypeAttribute ← ImplementsAttribute

Inherited Members​

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

Constructors​

ImplementsAttribute(Type, TypeGrouping)​

Initializes a new instance of the ImplementsAttribute class.

public ImplementsAttribute(Type interfaceType, TypeGrouping grouping)

Parameters​

interfaceType Type

Type of interface that selectable classes must implement.

grouping TypeGrouping

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

Properties​

InterfaceType​

Gets the type of interface that selectable classes must implement.

public Type InterfaceType { 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.