Struct ecs_trigger_t

Synopsis

#include <include/flecs.h>

struct ecs_trigger_t

Description

A trigger reacts to events matching a single term

A trigger reacts to events matching a single filter term

Source

Lines 287-311 in include/flecs.h.

struct ecs_trigger_t {
    ecs_term_t term;            /* Term describing the trigger condition id */

    /* Trigger events */
    ecs_entity_t events[ECS_TRIGGER_DESC_EVENT_COUNT_MAX];
    int32_t event_count;

    ecs_iter_action_t action;   /* Callback */

    void *ctx;                  /* Callback context */
    void *binding_ctx;          /* Binding context (for language bindings) */

    ecs_ctx_free_t ctx_free;    /* Callback to free ctx */
    ecs_ctx_free_t binding_ctx_free; /* Callback to free binding_ctx */

    ecs_entity_t entity;        /* Trigger entity */
    ecs_entity_t self;          /* Entity associated with observer */

    ecs_observable_t *observable;  /* Observable for trigger */

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

    uint64_t id;                /* Internal id */
};