pub fn gamepad_connection_system(
commands: Commands<'_, '_>,
connection_events: EventReader<'_, '_, GamepadConnectionEvent>,
)
Expand description
Handles GamepadConnectionEvent
s events.
On connection, adds the components representing a Gamepad
to the entity.
On disconnection, removes the Gamepad
and other related components.
Entities are left alive and might leave components like GamepadSettings
to preserve state in the case of a reconnection
ยงNote
Whenever a Gamepad
connects or disconnects, an information gets printed to the console using the info!
macro.