pub struct Main;
Expand description
The schedule that contains the app logic that is evaluated each tick of App::update()
.
By default, it will run the following schedules in the given order:
On the first run of the schedule (and only on the first run), it will run:
StateTransition
1- This means that
OnEnter(MyState::Foo)
will be called beforePreStartup
ifMyState
was added to the app withMyState::Foo
as the initial state, as well asOnEnter(MyComputedState)
if itcompute
s toSome(Self)
inMyState::Foo
. - If you want to run systems before any state transitions, regardless of which state is the starting state,
for example, for registering required components, you can add your own custom startup schedule
before
StateTransition
. SeeMainScheduleOrder::insert_startup_before
for more details.
- This means that
PreStartup
Startup
PostStartup
Then it will run:
First
PreUpdate
StateTransition
1RunFixedMainLoop
- This will run
FixedMain
zero to many times, based on how much time has elapsed.
- This will run
Update
PostUpdate
Last
§Rendering
Note rendering is not executed in the main schedule by default.
Instead, rendering is performed in a separate SubApp
which exchanges data with the main app in between the main schedule runs.
See RenderPlugin
and PipelinedRenderingPlugin
for more details.
StateTransition
is inserted only if you havebevy_state
feature enabled. It is enabled indefault
features. ↩
Implementations§
Trait Implementations§
Source§impl ScheduleLabel for Main
impl ScheduleLabel for Main
impl Eq for Main
impl StructuralPartialEq for Main
Auto Trait Implementations§
impl Freeze for Main
impl RefUnwindSafe for Main
impl Send for Main
impl Sync for Main
impl Unpin for Main
impl UnwindSafe for Main
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.