Skip to content

Feature request: on_enter and on_exit events should match prev state and next state filters respectively. #18

@ewmb7701

Description

@ewmb7701

I would like to match the prev state for on_enter events and the next state for on_exit events.

My goal is an on_enter and on_exit event which only triggers when I enter/ exit a group of states, but not when I transition between those states. That would look something like this:

  .on_enter::<OneOfState<(
      PlayerAirMoveDownStateComponent,
      PlayerAirMoveUpStateComponent,
  )>, Not<OneOfState<(
      PlayerAirMoveDownStateComponent,
      PlayerAirMoveUpStateComponent,
  )>>(|_ec| {
      bevy::log::info!("enter air");
  })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions