Click or drag to resize

ArticyTypeConstraintAttribute Class

This attribute can be used to limit the available options on ArticyRefs object picker.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    Articy.UnityArticyTypeConstraintAttribute

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
public sealed class ArticyTypeConstraintAttribute : Attribute

The ArticyTypeConstraintAttribute type exposes the following members.

Constructors
  NameDescription
Public methodArticyTypeConstraintAttribute
Initializes a new instance of the ArticyTypeConstraintAttribute class.
Top
Properties
  NameDescription
Public propertyConstraintTypes
Gets the list of type constraints.
Top
Remarks

Use this to restrict what objects can be picked in the unity editor for a specific ArticyRef.

Note Note
This does not restrict assignments in code and only restricts the choices inside the unity editor.
Examples
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)
}
See Also