ArticyTypeConstraintAttribute Class |
Namespace: Articy.Unity
public sealed class ArticyTypeConstraintAttribute : Attribute
The ArticyTypeConstraintAttribute type exposes the following members.
Name | Description | |
---|---|---|
ArticyTypeConstraintAttribute |
Initializes a new instance of the ArticyTypeConstraintAttribute class.
|
Name | Description | |
---|---|---|
ConstraintTypes |
Gets the list of type constraints.
|
Use this to restrict what objects can be picked in the unity editor for a specific ArticyRef.
Note |
---|
This does not restrict assignments in code and only restricts the choices inside the unity editor. |
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) }