Strata - v1.4.10
    Preparing search index...

    Interface TriggerComponent<T>

    Component data for a trigger.

    interface TriggerComponent<T extends BaseEntity = any> {
        action: (entity: T, trigger: T) => void;
        condition?: (entity: T, trigger: T) => boolean;
        cooldown?: number;
        enabled?: boolean;
        id: string;
        lastTriggered?: number;
        once?: boolean;
        radius?: number;
        shape?: TriggerShape;
        size?: [number, number, number];
        triggerCount?: number;
        type: TriggerType;
    }

    Type Parameters

    Index

    Properties

    action: (entity: T, trigger: T) => void

    The action to execute when the trigger is activated.

    condition?: (entity: T, trigger: T) => boolean

    Optional condition function that must return true for the trigger to fire.

    cooldown?: number

    Minimum time between activations in seconds.

    enabled?: boolean

    Whether the trigger is currently active.

    id: string

    Unique identifier for the trigger.

    lastTriggered?: number

    Timestamp of the last activation.

    once?: boolean

    If true, the trigger will only fire once and then disable itself.

    radius?: number

    Radius for 'sphere' and 'cylinder' shapes.

    shape?: TriggerShape

    The spatial shape of the trigger (for 'proximity' and 'collision').

    size?: [number, number, number]

    Dimensions [x, y, z] for 'box' shape.

    triggerCount?: number

    Number of times the trigger has been activated.

    The activation method for this trigger.