trigger
module is public
- Transitions sometimes failing when there are multiple entities with state machines
EventTrigger
re-export, making it accessible
Component
bound toMachineState
StateMachine::on_enter
andStateMachine::on_exit
that acceptFn(&mut EntityCommands)
StateMachine::command_on_enter
andStateMachine::command_on_exit
that accept aCommand
AndTrigger
andOrTrigger
that combine triggers with boolean logicTrigger::not
,Trigger::and
, andTrigger::or
combinators that constructNotTrigger
,AndTrigger
, andOrTrigger
respectivelyEventTrigger<E>
that triggers upon reading the eventStateMachine::set_trans_logging
for logging transitionsStateMachine::with_state
to register states that are not used in any transitions
StateMachine::new
has been replaced withStateMachine::default
, and you must insert the initial state manuallyStateMachine::trans_builder
's callback accepts a reference to the current stateStateMachine
no longer tracks the current state, so you may add and remove states manually- Transitions have priority in the order they are added to the
StateMachine
Trigger::Param
is aReadOnlySystemParam
instead ofSystemParam
, andTrigger::trigger
accepts it as an owned value, allowing them to useEventReader
,Local
, etc
TriggerPlugin
,trigger_plugin
,TriggerInputPlugin
andtrigger_input_plugin
;Triggers
no longer need to be registeredStateMachine::insert_on_enter
andStateMachine::remove_on_exit
Reflect
bound fromMachineState
andTrigger
- Updated
bevy
to 0.10 - Updated
leafwing-input-manager
to 0.9 AnyState
is uninhabited, so it cannot be constructed
insert_on_enter
inserting on exit instead of enter
StateMachine::trans_builder
builds a state based on data provided by the triggerAnyState
state that can be used in type parameters to represent any stateleafwing_input
feature for input-related triggers:ValueTrigger
,ClampedValueTrigger
,AxisPairTrigger
,ClampedAxisPairTrigger
,JustPressedTrigger
,PressedTrigger
,JustReleasedTrigger
,ReleasedTrigger
, andActionDataTrigger
InputTriggerPlugin<Actionlike>
for easily registering input-related triggersOptionTrigger
andBoolTrigger
offer simpler APIs thanTrigger
Never
type forTrigger::Err
when the trigger always occurs
- A panic will occur when using a trigger that hasn't been registered
Trigger
has associated typesOk
andErr
, andTrigger::trigger
returns aResult<Self::Ok, Self::Err>
, which are used in transition builders
Clone
andFromReflect
requirements forTrigger
Clone
fromStateMachine
FromReflect
re-export fromprelude
- Updated
bevy
to 0.9 Trigger::Param<'w, 's>
has lifetime parametersTrigger::trigger
accepts&Self::Param::Fetch::Item
instead of&StaticSystemParam<Self::Param>
Done
andDoneTrigger
are enums withSuccess
andFailure
variants
StaticSystemParam
re-export fromprelude
Done::success()
andDone::failure()
constructorsDoneTrigger::success()
andDoneTrigger::failure()
constructors
- Creating multiple transitions from the same
MachineState
andTrigger
type doesn't panic
StateMachine::insert_on_enter
configures theStateMachine
to insert a bundle when entering a stateStateMachine::remove_on_exit
configures theStateMachine
to remove a bundle when exiting a stateStaticSystemParam
andFromReflect
are re-exported inprelude
Done::success()
andDone::failure()
constructorsDoneTrigger::success()
andDoneTrigger::failure()
constructors
MachineState
s must implementBundle
and don't need to implementComponent
DoneTrigger
andDone
each have asuccess
field. So,DoneTrigger
will only trigger when aDone
component with a matchingsuccess
field is added.