Attribute Macro bevy_commandify::entity_command

source ·
#[entity_command]
Expand description

Promotes a function to an EntityCommand struct, and creates an equivalent EntityCommands method via trait extensions

  • #[entity_command(no_trait)] prevents generating a trait method for EntityCommands
  • #[entity_command(name = T)] will use this name for the method and related struct/trait names
  • #[entity_command(struct_name = T)] will use this name for the generated struct, defaults to <Foo>EntityCommand
  • #[entity_command(trait_name = T)] will use this name for the generated trait, defaults to EntityCommands<Foo>Ext
  • #[entity_command(ecs = T)] to change the crate root to T, defaults to bevy::ecs
  • #[entity_command(bevy_ecs)] to change the crate root to bevy_ecs

Note: Ts may be optionally quoted

Commands may optionally return &mut Self to allow chaining their calls