Trait bevy_cobweb::react::ReactionTriggerBundle
source · pub trait ReactionTriggerBundle: Copy + Clone + Send + Sync + 'static {
// Required methods
fn len(&self) -> usize;
fn collect_reactor_types(self, func: &mut impl FnMut(ReactorType));
fn register_triggers(
self,
commands: &mut Commands<'_, '_>,
handle: &ReactorHandle,
);
}
Expand description
Helper trait for registering reactors with ReactCommands
.
All members of a trigger bundle must implement ReactionTriggerBundle
. You should implement ReactionTrigger
on the root members of a bundle.
Required Methods§
sourcefn collect_reactor_types(self, func: &mut impl FnMut(ReactorType))
fn collect_reactor_types(self, func: &mut impl FnMut(ReactorType))
Traverses reactor types in the bundle.
sourcefn register_triggers(
self,
commands: &mut Commands<'_, '_>,
handle: &ReactorHandle,
)
fn register_triggers( self, commands: &mut Commands<'_, '_>, handle: &ReactorHandle, )
Registers reactors and passes the reactor types to the injected function.
Object Safety§
This trait is not object safe.