bevy/crates/bevy_app/src
Sou1gh0st 8c1b9a6c18
feat(bevy_app): expose an API to perform updates for a specific sub-app. (#14009)
# Objective

- Fixes https://github.com/bevyengine/bevy/issues/14003

## Solution

- Expose an API to perform updates for a specific sub-app, so we can
avoid mutable borrow the app twice.

## Testing

- I have tested the API by modifying the code in the `many_lights`
example with the following changes:
```rust
impl Plugin for LogVisibleLights {
    fn build(&self, app: &mut App) {
        let Some(render_app) = app.get_sub_app_mut(RenderApp) else {
            return;
        };

        render_app.add_systems(Render, print_visible_light_count.in_set(RenderSet::Prepare));
    }

    fn finish(&self, app: &mut App) {
        app.update_sub_app_by_label(RenderApp);
    }
}
```

---

## Changelog
- add the `update_sub_app_by_label` API to `App` and `SubApps`.

---------

Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
2024-06-26 00:13:24 +02:00
..
app.rs feat(bevy_app): expose an API to perform updates for a specific sub-app. (#14009) 2024-06-26 00:13:24 +02:00
lib.rs Computed State & Sub States (#11426) 2024-05-02 19:36:23 +00:00
main_schedule.rs fix docs around StateTransition and remove references to `apply_sta… (#13772) 2024-06-10 19:31:41 +02:00
panic_handler.rs Move PanicHandlerPlugin into bevy_app (#12640) 2024-03-29 02:04:56 +00:00
plugin_group.rs Added add_group to PluginGroupBuilder (#9530) 2024-02-25 21:23:28 +00:00
plugin.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
schedule_runner.rs Simplify runner app exit code. (#13074) 2024-04-23 20:42:00 +00:00
sub_app.rs feat(bevy_app): expose an API to perform updates for a specific sub-app. (#14009) 2024-06-26 00:13:24 +02:00