-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Support system.in_schedule()
and system.on_startup()
#7790
Conversation
This reverts commit 9a80674.
Alright, I've removed the state extension methods for now. We'll let the design for them cook a little more. I also replaced every usage of I think we should also deprecate |
system.in_schedule()
and system.on_enter(state)
system.in_schedule()
and system.on_startup()
Agreed on both counts. With the state API cut, I've removed the controversial label and feel good about getting this in. |
Example |
It seems to work fine on my machine. What does it mean when |
I think the bot is just slow. |
I realized that we probably don't want to expose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
# 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
Pull request successfully merged into main. Build succeeded:
|
system.in_schedule()
and system.on_startup()
system.in_schedule()
and system.on_startup()
Accomodate for bevyengine/bevy#7790
Accomodate for bevyengine/bevy#7790
…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
Objective
Support the following syntax for adding systems:
Solution
Add the traits
IntoSystemAppConfig{s}
, which provide the extension methods necessary for configuring which schedule a system belongs to. These extension methods returnIntoSystemAppConfig{s}
, whichApp::add_system{s}
uses to choose which schedule to add systems to.Changelog
in_schedule(label)
andon_startup()
for configuring the schedule a system belongs to.Future Work
add_startup_system
in the engine.