Replies: 5 comments 13 replies
-
Option 1:
|
Beta Was this translation helpful? Give feedback.
-
Option 2:
|
Beta Was this translation helpful? Give feedback.
-
Option 3Just use Instead of: app.add_system(foo.in_schedule(Bar)) You can use: app.edit_schedule(Bar, | schedule| { schedule.add_system(foo)) (This is mostly a joke, but since it was the inital API shipped in the ScheduleV3 PR it's worth at least ruling out). Pros
Cons
|
Beta Was this translation helpful? Give feedback.
-
Option 4Keep app.add_system(spawn_player.in_schedule(Startup)) Pros
Cons
|
Beta Was this translation helpful? Give feedback.
-
Option 5:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bevy now has a number of ways to add systems to schedules:
app.add_system(foo.in_schedule(X))
app.add_startup_system(foo)
.foo.in_schedule(CoreSchedule::Startup)
app.add_system(foo.on_startup())
There are proposals to deprecate
add_startup_system
foron_startup
(#7694).There are also proposals to add new
on_X
functions, such asfoo.on_enter(X)
(equivalent tofoo.in_schedule(OnEnter(X)
) andfoo.on_exit(X)
.Before we start embracing a pattern as the "one way to do things", we should discuss the problem being solved, motivation, and alternatives.
Here is a roll-up of the current options:
Beta Was this translation helpful? Give feedback.
All reactions