Note
This does not restrict assignments in code and only restricts the choices inside the unity editor.
public sealed class ArticyTypeConstraintAttribute : AttributeUse this to restrict what objects can be picked in the unity editor for a specific ArticyRef.
class MyScript : MonoBehaviour
{
public ArticyRef allObjects; // all objects would be available in the object picker
[ArticyTypeConstraint(typeof(IEntity))]
public ArticyRef allEntities; // all entities (With or without template)
[ArticyTypeConstraint(typeof(Entity))]
public ArticyRef noTemplateEntities; // all entities without a template would be available
[ArticyTypeConstraint(typeof(IEntity), typeof(IDialogue))]
public ArticyRef entityOrDialogues; // all entities and Dialogues (both with or without templates)
}| ArticyTypeConstraintAttribute | Initializes a new instance of the ArticyTypeConstraintAttribute class. |
| ConstraintTypes | Gets the list of type constraints. |