Struct ecs_trigger_desc_t

Synopsis

#include <include/flecs.h>

typedef struct ecs_trigger_desc_t

Description

Used with ecs_trigger_init.

Mentioned in

Source

Lines 503-541 in include/flecs.h.

typedef struct ecs_trigger_desc_t {
    /* Entity to associate with trigger */
    ecs_entity_desc_t entity;

    /* Term specifying the id to subscribe for */
    ecs_term_t term;

    /* Filter expression. May only contain a single term. If this field is set,
     * the term field is ignored. */
    const char *expr;

    /* Events to trigger on (OnAdd, OnRemove, OnSet, UnSet) */
    ecs_entity_t events[ECS_TRIGGER_DESC_EVENT_COUNT_MAX];

    /* Should trigger ignore prefabs & disabled entities */
    bool match_prefab;
    bool match_disabled;

    /* Callback to invoke on an event */
    ecs_iter_action_t callback;

    /* Associate with entity */
    ecs_entity_t self;

    /* User context to pass to callback */
    void *ctx;

    /* Context to be used for language bindings */
    void *binding_ctx;

    /* Callback to free ctx */
    ecs_ctx_free_t ctx_free;

    /* Callback to free binding_ctx */     
    ecs_ctx_free_t binding_ctx_free;

    /* Observable with which to register the trigger */
    ecs_poly_t *observable;
} ecs_trigger_desc_t;