Function insert_from_world

Source
pub fn insert_from_world<T: Component + FromWorld>(
    mode: InsertMode,
) -> impl EntityCommand
Expand description

An EntityCommand that adds a component to an entity using the component’s FromWorld implementation.

T::from_world will only be invoked if the component will actually be inserted. In other words, T::from_world will not be invoked if mode is InsertMode::Keep and the entity already has the component.