bevy_ecs::system::command

Function insert_batch

Source
pub fn insert_batch<I, B>(
    batch: I,
    insert_mode: InsertMode,
) -> impl Command<Result>
where I: IntoIterator<Item = (Entity, B)> + Send + Sync + 'static, B: Bundle<Effect: NoBundleEffect>,
Expand description

A Command that consumes an iterator to add a series of Bundles to a set of entities.

If any entities do not exist in the world, this command will return a TryInsertBatchError.

This is more efficient than inserting the bundles individually.