pub struct AbilityPlugin<A: Abilitylike> { /* private fields */ }Expand description
A Plugin that advances the abilities of type A.
This plugin ticks down the CooldownState and
ChargeState components of every entity with abilities of type A,
replenishing charges and refreshing cooldowns as they expire.
This plugin needs to be passed in an Abilitylike enum type that you’ve created for your game.
If you have more than one distinct type of action (e.g. menu actions, camera actions and player actions),
consider creating multiple Abilitylike enums and adding a copy of this plugin for each Abilitylike type.
§Systems
The plugin adds tick_cooldowns to
PreUpdate, in the AbilitySystem::TickCooldowns set.
It is ordered before InputManagerSystem::Update,
so cooldowns are advanced before action states are updated for the frame.
WARNING: These systems run during PreUpdate.
If you have systems that care about inputs and actions that also run during this stage,
you must define an ordering between your systems or behavior will be very erratic.
Trait Implementations§
Source§impl<A: Abilitylike> Default for AbilityPlugin<A>
impl<A: Abilitylike> Default for AbilityPlugin<A>
Source§impl<A: Abilitylike> Plugin for AbilityPlugin<A>
impl<A: Abilitylike> Plugin for AbilityPlugin<A>
Source§fn ready(&self, _app: &App) -> bool
fn ready(&self, _app: &App) -> bool
finish should be called.Source§fn finish(&self, _app: &mut App)
fn finish(&self, _app: &mut App)
App, once all plugins registered are ready. This can
be useful for plugins that depends on another plugin asynchronous setup, like the renderer.Source§fn cleanup(&self, _app: &mut App)
fn cleanup(&self, _app: &mut App)
Auto Trait Implementations§
impl<A> Freeze for AbilityPlugin<A>where
PhantomData<A>: Freeze,
impl<A> RefUnwindSafe for AbilityPlugin<A>where
PhantomData<A>: RefUnwindSafe,
impl<A> Send for AbilityPlugin<A>where
PhantomData<A>: Send,
impl<A> Sync for AbilityPlugin<A>where
PhantomData<A>: Sync,
impl<A> Unpin for AbilityPlugin<A>where
PhantomData<A>: Unpin,
impl<A> UnsafeUnpin for AbilityPlugin<A>where
PhantomData<A>: UnsafeUnpin,
impl<A> UnwindSafe for AbilityPlugin<A>where
PhantomData<A>: UnwindSafe,
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
impl<T> ConditionalSend for Twhere
T: Send,
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<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().
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