bevy/examples/ecs
Freyja-moth 714b4a43d6
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-09 02:34:49 +00:00
..
change_detection.rs Rename track_change_detection flag to track_location (#17075) 2025-01-01 18:43:47 +00:00
component_hooks.rs Preserve spawned RelationshipTarget order and other improvements (#17858) 2025-03-05 22:18:57 +00:00
custom_query_param.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
custom_schedule.rs
dynamic.rs Remove deprecated component_reads_and_writes (#16348) 2025-03-04 08:22:29 +00:00
ecs_guide.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
entity_disabling.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
error_handling.rs Use Display instead of Debug in the default error handler (#18629) 2025-03-31 18:28:19 +00:00
event.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
fallible_params.rs Replace ValidationOutcome with Result (#18541) 2025-03-26 03:36:16 +00:00
fixed_timestep.rs
generic_system.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
hierarchy.rs Add an example teaching users about custom relationships (#17443) 2025-01-20 23:17:38 +00:00
immutable_components.rs Improved Entity Mapping and Cloning (#17687) 2025-02-06 22:13:41 +00:00
iter_combinations.rs
nondeterministic_system_order.rs Fix non-functional nondeterministic_system_order example (#10719) 2023-11-25 21:13:35 +00:00
observer_propagation.rs Improve derive(Event) and simplify macro code (#18083) 2025-03-07 02:01:23 +00:00
observers.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
one_shot_systems.rs Merge Style properties into Node. Use ComputedNode for computed properties. (#15975) 2024-10-18 22:25:33 +00:00
parallel_query.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
relationships.rs Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-09 02:34:49 +00:00
removal_detection.rs Rename trigger.entity() to trigger.target() (#16716) 2024-12-08 21:55:09 +00:00
run_conditions.rs aligning public apis of Time,Timer and Stopwatch (#15962) 2024-10-16 21:09:32 +00:00
send_and_receive_events.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
startup_system.rs
system_closure.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
system_param.rs
system_piping.rs Fix a few typos (#17292) 2025-01-10 22:48:30 +00:00
system_stepping.rs