pub enum ModSchedule {
ModStartup,
PreUpdate,
Update,
PostUpdate,
FixedPreUpdate,
FixedUpdate,
FixedPostUpdate,
Custom {
name: String,
schedule: Interned<dyn ScheduleLabel>,
},
}Expand description
This is an enum representing schedules in Bevy where mods can also be run.
See the docs for bevy schedules.
Call ModloaderPlugin::enable_schedule to enable new or custom schedules for mods.
None of the startup schedules (like PreStartup, Startup, etc) are included since mods can’t usually run within them, since mods take time to load and begin loading these schedules have finished running.
Variants§
ModStartup
A custom schedule that runs the first time a mod is loaded.
It is a custom schedule that runs during the setup schedule (which defaults to First), see ModloaderPlugin::set_setup_schedule).
Upon being loaded, mods are guaranteed to only run this schedule once, even if other mods are loaded afterwards.
PreUpdate
See the Bevy schedule PreUpdate
Update
See the Bevy schedule Update
PostUpdate
See the Bevy schedule PostUpdate
FixedPreUpdate
See the Bevy schedule FixedPreUpdate
FixedUpdate
See the Bevy schedule FixedUpdate
FixedPostUpdate
See the Bevy schedule FixedPostUpdate
Custom
A custom schedule. See ModSchedule::new_custom for more details.
Implementations§
Source§impl ModSchedule
impl ModSchedule
Sourcepub fn new_custom(name: impl ToString, schedule: impl ScheduleLabel) -> Self
pub fn new_custom(name: impl ToString, schedule: impl ScheduleLabel) -> Self
A custom schedule for the Modloader
namemust match what the mod registers with via the wit apischeduleis the Bevy schedule this represents. This schedule must be added to the Bevy Schedules.
Note: Trying to add mod systems to the setup schedule (which defaults to First, see ModloaderPlugin::set_setup_schedule) Bevy’s First schedule will do nothing since this is the mod setup phase
Sourcepub fn schedule_label(&self) -> Interned<dyn ScheduleLabel>
pub fn schedule_label(&self) -> Interned<dyn ScheduleLabel>
Returns a bevy ScheduleLabel. This can be passed into any methods that accept an impl ScheduleLabel.
Trait Implementations§
Source§impl Clone for ModSchedule
impl Clone for ModSchedule
Source§fn clone(&self) -> ModSchedule
fn clone(&self) -> ModSchedule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModSchedule
impl Debug for ModSchedule
Source§impl PartialEq for ModSchedule
impl PartialEq for ModSchedule
impl Eq for ModSchedule
impl StructuralPartialEq for ModSchedule
Auto Trait Implementations§
impl Freeze for ModSchedule
impl !RefUnwindSafe for ModSchedule
impl Send for ModSchedule
impl Sync for ModSchedule
impl Unpin for ModSchedule
impl UnsafeUnpin for ModSchedule
impl !UnwindSafe for ModSchedule
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
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>
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>
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)
&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)
&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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more