bevy/crates/bevy_ecs/src/observer
Freyja-moth 772524b3a6 Change with_related to work with a Bundle and added with_relationships method (#18699)
# Objective

Fixes #18678

## Solution

Moved the current `with_related` method to `with_relationships` and
added a new `with_related` that uses a bundle.

I'm not entirely sold on the name just yet, if anyone has any ideas let
me know.

## Testing

I wasn't able to test these changes because it crashed my computer every
time I tried (fun). But there don't seem to be any tests that use the
old `with_related` method so it should be fine, hopefully

## Showcase

```rust
commands.spawn_empty()
    .with_related::<Relationship>(Name::new("Related thingy"))
    .with_relationships(|rel| {
        rel.spawn(Name::new("Second related thingy"));
    });
```

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2025-04-10 01:19:33 +02:00
..
entity_observer.rs Replace VisitEntities with MapEntities (#18432) 2025-03-24 00:09:29 +01:00
mod.rs Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-10 01:19:33 +02:00
runner.rs Fix run_system for adapter systems wrapping exclusive systems (#18406) 2025-03-26 19:06:51 +01:00