diff --git a/crates/beet_ecs/src/observers/mod.rs b/crates/beet_ecs/src/observers/mod.rs index dd452c43..25731427 100644 --- a/crates/beet_ecs/src/observers/mod.rs +++ b/crates/beet_ecs/src/observers/mod.rs @@ -1,12 +1,12 @@ pub mod action_observer; #[allow(unused_imports)] pub use self::action_observer::*; -pub mod action_observers_builder; -#[allow(unused_imports)] -pub use self::action_observers_builder::*; pub mod action_observer_map; #[allow(unused_imports)] pub use self::action_observer_map::*; +pub mod action_observers_builder; +#[allow(unused_imports)] +pub use self::action_observers_builder::*; pub mod add_observer_hooks; #[allow(unused_imports)] pub use self::add_observer_hooks::*; diff --git a/crates/beet_examples/src/lib.rs b/crates/beet_examples/src/lib.rs index 40717393..95be29d6 100644 --- a/crates/beet_examples/src/lib.rs +++ b/crates/beet_examples/src/lib.rs @@ -1,15 +1,12 @@ // #![allow(unused, dead_code)] pub mod serde_utils; - pub mod components; -pub mod net; pub mod plugins; pub mod scenes; pub mod prelude { pub use crate::components::*; - pub use crate::net::*; pub use crate::plugins::*; pub use crate::scenes; pub use crate::serde_utils::*; diff --git a/crates/beet_examples/src/net/mod.rs b/crates/beet_examples/src/net/mod.rs deleted file mode 100644 index 6de09142..00000000 --- a/crates/beet_examples/src/net/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod example_replicate_plugin; -#[allow(unused_imports)] -pub use self::example_replicate_plugin::*; diff --git a/crates/beet_examples/src/plugins/example_default_plugins.rs b/crates/beet_examples/src/plugins/example_default_plugins.rs index 624c41fb..468d0321 100644 --- a/crates/beet_examples/src/plugins/example_default_plugins.rs +++ b/crates/beet_examples/src/plugins/example_default_plugins.rs @@ -1,6 +1,4 @@ -#[cfg(any(target_arch = "wasm32", feature = "tokio"))] -use crate::beet::prelude::*; -use crate::prelude::load_scenes_from_args; +use crate::prelude::*; use bevy::asset::AssetMetaCheck; use bevy::input::common_conditions::input_toggle_active; use bevy::prelude::*; @@ -13,20 +11,10 @@ use forky_bevy::systems::close_on_esc; #[derive(Default)] pub struct ExampleDefaultPlugins; - -#[cfg(feature = "tokio")] -const DEFAULT_SOCKET_URL: &str = "ws://127.0.0.1:3000/ws"; - impl Plugin for ExampleDefaultPlugins { fn build(&self, app: &mut App) { assert_local_assets(); - #[cfg(target_arch = "wasm32")] - app.add_transport(WebEventClient::new_with_window()); - - #[cfg(feature = "tokio")] - app.add_transport(NativeWsClient::new(DEFAULT_SOCKET_URL).unwrap()); - app.add_plugins(( DefaultPlugins .set(WindowPlugin { diff --git a/crates/beet_examples/src/net/example_replicate_plugin.rs b/crates/beet_examples/src/plugins/example_replicate_plugin.rs similarity index 66% rename from crates/beet_examples/src/net/example_replicate_plugin.rs rename to crates/beet_examples/src/plugins/example_replicate_plugin.rs index 57392956..20ab701e 100644 --- a/crates/beet_examples/src/net/example_replicate_plugin.rs +++ b/crates/beet_examples/src/plugins/example_replicate_plugin.rs @@ -11,6 +11,15 @@ impl Plugin for ExampleReplicatePlugin { .add_event::() .replicate_event_incoming::() /*-*/; + + #[cfg(feature = "tokio")] + const DEFAULT_SOCKET_URL: &str = "ws://127.0.0.1:3000/ws"; + + #[cfg(target_arch = "wasm32")] + app.add_transport(WebEventClient::new_with_window()); + + #[cfg(feature = "tokio")] + app.add_transport(NativeWsClient::new(DEFAULT_SOCKET_URL).unwrap()); } } diff --git a/crates/beet_examples/src/plugins/mod.rs b/crates/beet_examples/src/plugins/mod.rs index cb5e89ab..62afcfb2 100644 --- a/crates/beet_examples/src/plugins/mod.rs +++ b/crates/beet_examples/src/plugins/mod.rs @@ -4,3 +4,6 @@ pub use self::example_default_plugins::*; pub mod example_plugin_group; #[allow(unused_imports)] pub use self::example_plugin_group::*; +pub mod example_replicate_plugin; +#[allow(unused_imports)] +pub use self::example_replicate_plugin::*;