UnityEngine.PropertyAttribute
to filter the assigned object type by constraints.
More...
Inherits PropertyAttribute.
Public Member Functions | |
TypeConstraintAttribute () | |
Activate the UnityEngine.Component selecting menu. More... | |
TypeConstraintAttribute (params Type[] constraints) | |
Setup constraint types to filter, or only activate the selecting menu if nothing assigned. More... | |
Public Attributes | |
readonly Type[] | constraints |
The constraint types to filter assigned object. More... | |
UnityEngine.PropertyAttribute
to filter the assigned object type by constraints.
Draw a common object field, but filter the assigned object type by constraint types. Generally for interface, a valid object has to derive from or implement all constraints. If there're multiple valid UnityEngine.Component
attached to the same UnityEngine.GameObject
. Also able to select one of them by right clicking on the object field.
Declaring examples below:
Activate the UnityEngine.Component
selecting menu.
TypeConstraintAttribute | ( | params Type[] | constraints | ) |
Setup constraint types to filter, or only activate the selecting menu if nothing assigned.
constraints | Constraints. |
readonly Type [] constraints |
The constraint types to filter assigned object.