pub fn release_on_input_map_removed<A: Actionlike>(
removed_components: RemovedComponents<'_, '_, InputMap<A>>,
input_map_resource: Option<ResMut<'_, InputMap<A>>>,
action_state_resource: Option<ResMut<'_, ActionState<A>>>,
input_map_resource_existed: Local<'_, bool>,
action_state_query: Query<'_, '_, &mut ActionState<A>>,
)
Expand description
Release all inputs when an InputMap<A>
is removed to prevent them from being held forever.
By default, InputManagerPlugin<A>
will run this on PostUpdate
.
For components you must remove the InputMap<A>
before PostUpdate
or this will not run.