pub fn update_action_state_from_interaction<A: Actionlike>(
    ui_query: Query<(&Interaction, &ActionStateDriver<A>)>,
    mut action_state_query: Query<&mut ActionState<A>>,
) {
    for (&interaction, action_state_driver) in ui_query.iter() {
        if interaction == Interaction::Clicked {
            let mut action_state = action_state_query
                .get_mut(action_state_driver.entity)
                .expect("Entity does not exist, or does not have an `ActionState` component.");
            action_state.press(&action_state_driver.action);
        }
    }
}
/// When a button with a component `A` is clicked, press the corresponding virtual button in the [`ActionState`]
///
/// The action triggered is determined by the variant stored in your UI-defined button.
When a button with a component `A` is clicked, press the corresponding virtual button in the [`ActionState`]
The action triggered is determined by the variant stored in your UI-defined button.
When a button with a component ` A ` is clicked press the corresponding virtual button in the [ ` ActionState ` ] The action triggered is determined by the variant stored in your UI - defined button .
pub fn update_action_state_from_interaction<A: Actionlike>(
    ui_query: Query<(&Interaction, &ActionStateDriver<A>)>,
    mut action_state_query: Query<&mut ActionState<A>>,
) {
    for (&interaction, action_state_driver) in ui_query.iter() {
        if interaction == Interaction::Clicked {
            let mut action_state = action_state_query
                .get_mut(action_state_driver.entity)
                .expect("Entity does not exist, or does not have an `ActionState` component.");
            action_state.press(&action_state_driver.action);
        }
    }
}
pub fn update_action_state_from_interaction < A : Actionlike > ( ui_query : Query < ( & Interaction , & ActionStateDriver < A > ) > , mut action_state_query : Query < & mut ActionState < A > > , ) { for ( & interaction , action_state_driver ) in ui_query . iter ( ) { if interaction == Interaction :: Clicked { let mut action_state = action_state_query . get_mut ( action_state_driver . entity ) . expect ( " " ) ; action_state . press ( & action_state_driver . action ) ; } } }
When a button with a component `A` is clicked, press the corresponding virtual button in the [`ActionState`]
The action triggered is determined by the variant stored in your UI-defined button.
When a button with a component ` A ` is clicked press the corresponding virtual button in the [ ` ActionState ` ] The action triggered is determined by the variant stored in your UI - defined button .
ui_query
Query<(&Interaction, &ActionStateDriver<A>)>
action_state_query
Query<&mut ActionState<A>>
ui_query
Query<(&Interaction, &ActionStateDriver<A>)>
action_state_query
Query<&mut ActionState<A>>