ecs_get_timeout

Function ecs_get_timeout 

Source
pub unsafe extern "C" fn ecs_get_timeout(
    world: *const ecs_world_t,
    tick_source: ecs_entity_t,
) -> f32
Expand description

Get current timeout value for the specified timer. This operation returns the value set by ecs_set_timeout. If no timer is active for this entity, the operation returns 0.

After the timeout expires the EcsTimer component is removed from the entity. This means that if ecs_get_timeout is invoked after the timer is expired, the operation will return 0.

The timer is synchronous, and is incremented each frame by delta_time.

The tick_source entity will be a tick source after this operation. Tick sources can be read by getting the EcsTickSource component. If the tick source ticked this frame, the ‘tick’ member will be true. When the tick source is a system, the system will tick when the timer ticks.

@param world The world. @param tick_source The timer. @return The current timeout value, or 0 if no timer is active.