bevy/examples/2d
JoJoJet b8263b55fb Support system.in_schedule() and system.on_startup() (#7790)
# Objective

Support the following syntax for adding systems:

```rust
App::new()
    .add_system(setup.on_startup())
    .add_systems((
        show_menu.in_schedule(OnEnter(GameState::Paused)),
        menu_ssytem.in_set(OnUpdate(GameState::Paused)),
        hide_menu.in_schedule(OnExit(GameState::Paused)),
    ))
```

## Solution

Add the traits `IntoSystemAppConfig{s}`, which provide the extension methods necessary for configuring which schedule a system belongs to. These extension methods return `IntoSystemAppConfig{s}`, which `App::add_system{s}` uses to choose which schedule to add systems to.

---

## Changelog

+ Added the extension methods `in_schedule(label)` and  `on_startup()` for configuring the schedule a system belongs to.

## Future Work

* Replace all uses of `add_startup_system` in the engine.
* Deprecate this method
2023-02-24 18:33:55 +00:00
..
2d_shapes.rs Add quad to 2d_shapes example (#7708) 2023-02-17 01:50:20 +00:00
mesh2d.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
mesh2d_manual.rs Support system.in_schedule() and system.on_startup() (#7790) 2023-02-24 18:33:55 +00:00
mesh2d_vertex_color_texture.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
move_sprite.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
pixel_perfect.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
rotation.rs Support system.in_schedule() and system.on_startup() (#7790) 2023-02-24 18:33:55 +00:00
sprite.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
sprite_flipping.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
sprite_sheet.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
text2d.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
texture_atlas.rs Support system.in_schedule() and system.on_startup() (#7790) 2023-02-24 18:33:55 +00:00
transparency_2d.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00