diff --git a/bevy_renet/src/steam.rs b/bevy_renet/src/steam.rs index b39c0c97..f1b740c4 100644 --- a/bevy_renet/src/steam.rs +++ b/bevy_renet/src/steam.rs @@ -69,13 +69,14 @@ impl Plugin for SteamClientPlugin { app.add_systems( PreUpdate, Self::update_system + .in_set(RenetReceive) .run_if(resource_exists::()) .run_if(resource_exists::()) .after(RenetClientPlugin::update_system), ); app.add_systems( PostUpdate, - (Self::send_packets, Self::disconnect_on_exit) + (Self::send_packets.in_set(RenetSend), Self::disconnect_on_exit) .run_if(resource_exists::()) .run_if(resource_exists::()), ); @@ -83,11 +84,11 @@ impl Plugin for SteamClientPlugin { } impl SteamClientPlugin { - pub fn update_system(mut transport: ResMut, mut client: ResMut) { + fn update_system(mut transport: ResMut, mut client: ResMut) { transport.update(&mut client); } - pub fn send_packets( + fn send_packets( mut transport: ResMut, mut client: ResMut, mut transport_errors: EventWriter, diff --git a/bevy_renet/src/transport.rs b/bevy_renet/src/transport.rs index bb6b79a9..6c5b9e84 100644 --- a/bevy_renet/src/transport.rs +++ b/bevy_renet/src/transport.rs @@ -63,13 +63,14 @@ impl Plugin for NetcodeClientPlugin { app.add_systems( PreUpdate, Self::update_system + .in_set(RenetReceive) .run_if(resource_exists::()) .run_if(resource_exists::()) .after(RenetClientPlugin::update_system), ); app.add_systems( PostUpdate, - (Self::send_packets, Self::disconnect_on_exit) + (Self::send_packets.in_set(RenetSend), Self::disconnect_on_exit) .run_if(resource_exists::()) .run_if(resource_exists::()), ); @@ -77,7 +78,7 @@ impl Plugin for NetcodeClientPlugin { } impl NetcodeClientPlugin { - pub fn update_system( + fn update_system( mut transport: ResMut, mut client: ResMut, time: Res