bevy/crates
davier 0c374df712 Add insert_children and push_children to EntityMut (#1728)
The only API to add a parent/child relationship between existing entities is through commands, there is no easy way to do it from `World`. Manually inserting the components is not completely possible since `PreviousParent` has no public constructor.

This PR adds two methods to set entities as children of an `EntityMut`: `insert_children` and `push_children`. ~~The API is similar to the one on `Commands`, except that the parent is the `EntityMut`.~~ The API is the same as in #1703.
However, the `Parent` and `Children` components are defined in `bevy_transform` which depends on `bevy_ecs`, while `EntityMut` is defined in `bevy_ecs`, so the methods are added to the `BuildWorldChildren` trait instead.
If #1545 is merged this should be fixed too.

I'm aware cart was experimenting with entity hierarchies, but unless it's a coming soon this PR would be useful to have meanwhile.

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-03-26 20:03:12 +00:00
..
bevy_app Add register_component to AppBuilder and improve error message (#1750) 2021-03-26 04:15:07 +00:00
bevy_asset fix clippy lints (#1756) 2021-03-25 20:48:18 +00:00
bevy_audio Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_core Reliable change detection (#1471) 2021-03-19 17:53:26 +00:00
bevy_derive format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_diagnostic ♻️ Timer refactor to duration. Add Stopwatch struct. (#1151) 2021-03-05 19:59:14 +00:00
bevy_dylib release 0.4.0 (#1093) 2020-12-19 13:28:00 -06:00
bevy_dynamic_plugin update libloading (#1543) 2021-03-03 03:11:12 +00:00
bevy_ecs Fix tiny state docs inconsistency (#1764) 2021-03-26 18:30:28 +00:00
bevy_gilrs Resolve (most) internal system ambiguities (#1606) 2021-03-10 22:37:02 +00:00
bevy_gltf gltf: load normal and occlusion as linear textures (#1762) 2021-03-26 18:47:47 +00:00
bevy_input format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_internal Rebase of existing PBR work (#1554) 2021-03-20 03:22:33 +00:00
bevy_log Bevy ECS V2 (#1525) 2021-03-05 07:54:35 +00:00
bevy_math use std clamp instead of Bevy's (#1644) 2021-03-13 18:07:14 +00:00
bevy_pbr Rebase of existing PBR work (#1554) 2021-03-20 03:22:33 +00:00
bevy_reflect fix clippy lints (#1756) 2021-03-25 20:48:18 +00:00
bevy_render fix clippy lints (#1756) 2021-03-25 20:48:18 +00:00
bevy_scene Make Commands and World apis consistent (#1703) 2021-03-23 00:23:40 +00:00
bevy_sprite Disable frustum culling and add warning (#1761) 2021-03-25 22:05:28 +00:00
bevy_tasks format comments (#1612) 2021-03-11 00:27:30 +00:00
bevy_text Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_transform Add insert_children and push_children to EntityMut (#1728) 2021-03-26 20:03:12 +00:00
bevy_ui Frustum Culling (for Sprites) (#1492) 2021-03-24 21:29:53 +00:00
bevy_utils Update ahash requirement from 0.6.1 to 0.7.0 (#1370) 2021-02-01 13:29:54 -08:00
bevy_wgpu fix clippy lints (#1756) 2021-03-25 20:48:18 +00:00
bevy_window Derive PartialEq for WindowMode (#1688) 2021-03-18 23:47:34 +00:00
bevy_winit format comments (#1612) 2021-03-11 00:27:30 +00:00