ArticyTypeConstraintAttribute Class

This attribute can be used to limit the available options on ArticyRefs object picker.

Definition

Namespace: Articy.Unity
Assembly: ArticyRuntime (in ArticyRuntime.dll) Version: 1.3.0
C#
public sealed class ArticyTypeConstraintAttribute : Attribute
Inheritance
Object    Attribute    ArticyTypeConstraintAttribute

Remarks

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.

Example

C#
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)
}

Constructors

ArticyTypeConstraintAttribute Initializes a new instance of the ArticyTypeConstraintAttribute class.

Properties

ConstraintTypes Gets the list of type constraints.

See Also