-
-
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
Add World::try_run_schedule #8028
Add World::try_run_schedule #8028
Conversation
The diff / commit history looks wrong, so this is quite hard to review. Are you able to clean that up? |
Yea sorry about that @alice-i-cecile, messed up my history trying to rebase, fixing it now. 😅 |
69b1f51
to
bfbffd3
Compare
Code itself LGTM. Can we use this internally anywhere? I know that state transitions wanted this: do enter / exit want it too already? |
We could certainly move towards full lazy initialization for State schedules by removing these: bevy/crates/bevy_app/src/app.rs Lines 359 to 366 in 4714130
And using bevy/crates/bevy_ecs/src/schedule/state.rs Lines 104 to 106 in 4714130
bevy/crates/bevy_ecs/src/schedule/state.rs Lines 120 to 128 in 4714130
@james7132 @alice-i-cecile Thoughts? |
I like that much better! |
Co-authored-by: James Liu <contact@jamessliu.com>
Co-authored-by: James Liu <contact@jamessliu.com>
Co-authored-by: James Liu <contact@jamessliu.com>
Objective
Fix #8018
Solution
Added a new method
World::try_run_schedule
that returns a Result instead of panicking if the schedule doesn't exist.Changelog
Added
World::try_run_schedule
: Attempt to run a schedule and return a Result rather than panicking if the schedule doesn't exist.