Skip to main content

GetComponentsInterfaceAttribute

A class in Alta.Attributes, the global namespace.

Array field attribute that fills the field with every component implementing an interface. The field must hold MonoBehaviour elements.

Constructors​

MemberWhat it is
GetComponentsInterfaceAttribute(Type type)Creates a GetComponentsInterfaceAttribute from type.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerNLog logger for this class.

Properties​

MemberWhat it is
bool IncludeInActive { get; set; }Settable but not used by this class or its children variant.
Type Type { get; }Interface type to look for, set in the constructor.
bool WarnOnEmpty { get; set; }Meant to log when nothing is found, but the check is never reached.

Methods​

MemberWhat it is
virtual Component[] GetComponents(Transform transform, Type type)Components on this object that implement the type. Overridden to search children.
override bool HandleApply(Component component, FieldInfo field, GameObject prefab)Replaces the array with a new MonoBehaviour array if the found components differ.