Repository navigation
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_schedulethat 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.