Function ecs_enable_component_w_id

Synopsis

#include <include/flecs.h>

FLECS_API void ecs_enable_component_w_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id, bool enable)

Description

Enable or disable component. Enabling or disabling a component does not add or remove a component from an entity, but prevents it from being matched with queries. This operation can be useful when a component must be temporarily disabled without destroying its value. It is also a more performant operation for when an application needs to add/remove components at high frequency, as enabling/disabling is cheaper than a regular add or remove.

Parameters

world - The world.

entity - The entity.

id - The component.

enable - True to enable the component, false to disable.

Source

Line 1011 in include/flecs.h.