Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Objective Make it easy to get the ids of all the components in a bundle (and initialise any components not yet initialised). This is fairly similar to the `Bundle::get_component_ids()` method added in the observers PR however that will return none for any non-initialised components. This is exactly the API space covered by `Bundle::component_ids()` however that isn't possible to call outside of `bevy_ecs` as it requires `&mut Components` and `&mut Storages`. ## Solution Added `World.init_bundle<B: Bundle>()` which similarly to `init_component` and `init_resource`, initialises all components in the bundle and returns a vector of their component ids. --- ## Changelog Added the method `init_bundle` to `World` as a counterpart to `init_component` and `init_resource`. --------- Co-authored-by: James Liu <[email protected]>
- Loading branch information