diff --git a/Cargo.toml b/Cargo.toml index a2a953e7c56e3..588cbf6500fa0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,10 @@ members = [ [features] default = [ "animation", + "bevy_asset", "bevy_audio", "bevy_gilrs", + "bevy_scene", "bevy_winit", "render", "png", @@ -53,6 +55,7 @@ render = [ # Optional bevy crates bevy_animation = ["bevy_internal/bevy_animation"] +bevy_asset = ["bevy_internal/bevy_asset"] bevy_audio = ["bevy_internal/bevy_audio"] bevy_core_pipeline = ["bevy_internal/bevy_core_pipeline"] bevy_dynamic_plugin = ["bevy_internal/bevy_dynamic_plugin"] @@ -60,6 +63,7 @@ bevy_gilrs = ["bevy_internal/bevy_gilrs"] bevy_gltf = ["bevy_internal/bevy_gltf"] bevy_pbr = ["bevy_internal/bevy_pbr"] bevy_render = ["bevy_internal/bevy_render"] +bevy_scene = ["bevy_internal/bevy_scene"] bevy_sprite = ["bevy_internal/bevy_sprite"] bevy_text = ["bevy_internal/bevy_text"] bevy_ui = ["bevy_internal/bevy_ui"] diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 7fccda37863d0..e54da26d981d0 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -66,7 +66,6 @@ animation = ["bevy_animation", "bevy_gltf?/bevy_animation"] [dependencies] # bevy bevy_app = { path = "../bevy_app", version = "0.8.0-dev" } -bevy_asset = { path = "../bevy_asset", version = "0.8.0-dev" } bevy_core = { path = "../bevy_core", version = "0.8.0-dev" } bevy_derive = { path = "../bevy_derive", version = "0.8.0-dev" } bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.8.0-dev" } @@ -77,7 +76,6 @@ bevy_log = { path = "../bevy_log", version = "0.8.0-dev" } bevy_math = { path = "../bevy_math", version = "0.8.0-dev" } bevy_ptr = { path = "../bevy_ptr", version = "0.8.0-dev" } bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", features = ["bevy"] } -bevy_scene = { path = "../bevy_scene", version = "0.8.0-dev" } bevy_time = { path = "../bevy_time", version = "0.8.0-dev" } bevy_transform = { path = "../bevy_transform", version = "0.8.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" } @@ -85,12 +83,14 @@ bevy_window = { path = "../bevy_window", version = "0.8.0-dev" } bevy_tasks = { path = "../bevy_tasks", version = "0.8.0-dev" } # bevy (optional) bevy_animation = { path = "../bevy_animation", optional = true, version = "0.8.0-dev" } +bevy_asset = { path = "../bevy_asset", optional = true, version = "0.8.0-dev" } bevy_audio = { path = "../bevy_audio", optional = true, version = "0.8.0-dev" } bevy_core_pipeline = { path = "../bevy_core_pipeline", optional = true, version = "0.8.0-dev" } bevy_gltf = { path = "../bevy_gltf", optional = true, version = "0.8.0-dev" } bevy_pbr = { path = "../bevy_pbr", optional = true, version = "0.8.0-dev" } bevy_render = { path = "../bevy_render", optional = true, version = "0.8.0-dev" } bevy_dynamic_plugin = { path = "../bevy_dynamic_plugin", optional = true, version = "0.8.0-dev" } +bevy_scene = { path = "../bevy_scene", optional = true, version = "0.8.0-dev" } bevy_sprite = { path = "../bevy_sprite", optional = true, version = "0.8.0-dev" } bevy_text = { path = "../bevy_text", optional = true, version = "0.8.0-dev" } bevy_ui = { path = "../bevy_ui", optional = true, version = "0.8.0-dev" } diff --git a/crates/bevy_internal/src/default_plugins.rs b/crates/bevy_internal/src/default_plugins.rs index 7bdb4c8af4ae4..07383f5023f5a 100644 --- a/crates/bevy_internal/src/default_plugins.rs +++ b/crates/bevy_internal/src/default_plugins.rs @@ -34,9 +34,14 @@ impl PluginGroup for DefaultPlugins { group.add(bevy_diagnostic::DiagnosticsPlugin::default()); group.add(bevy_input::InputPlugin::default()); group.add(bevy_window::WindowPlugin::default()); + + #[cfg(feature = "bevy_asset")] group.add(bevy_asset::AssetPlugin::default()); + #[cfg(feature = "debug_asset_server")] group.add(bevy_asset::debug_asset_server::DebugAssetServerPlugin::default()); + + #[cfg(feature = "bevy_scene")] group.add(bevy_scene::ScenePlugin::default()); #[cfg(feature = "bevy_winit")] diff --git a/crates/bevy_internal/src/lib.rs b/crates/bevy_internal/src/lib.rs index cc63909ab3cb8..a9158f0bafacb 100644 --- a/crates/bevy_internal/src/lib.rs +++ b/crates/bevy_internal/src/lib.rs @@ -12,6 +12,7 @@ pub mod app { pub use bevy_app::*; } +#[cfg(feature = "bevy_asset")] pub mod asset { //! Load and store assets and resources for Apps. pub use bevy_asset::*; @@ -60,6 +61,7 @@ pub mod reflect { }; } +#[cfg(feature = "bevy_scene")] pub mod scene { //! Save/load collections of entities and components to/from file. pub use bevy_scene::*; diff --git a/crates/bevy_internal/src/prelude.rs b/crates/bevy_internal/src/prelude.rs index fd2cb9d848327..cc3614544d0bb 100644 --- a/crates/bevy_internal/src/prelude.rs +++ b/crates/bevy_internal/src/prelude.rs @@ -1,13 +1,16 @@ #[doc(hidden)] pub use crate::{ - app::prelude::*, asset::prelude::*, core::prelude::*, ecs::prelude::*, hierarchy::prelude::*, - input::prelude::*, log::prelude::*, math::prelude::*, reflect::prelude::*, scene::prelude::*, - time::prelude::*, transform::prelude::*, utils::prelude::*, window::prelude::*, DefaultPlugins, - MinimalPlugins, + app::prelude::*, core::prelude::*, ecs::prelude::*, hierarchy::prelude::*, input::prelude::*, + log::prelude::*, math::prelude::*, reflect::prelude::*, time::prelude::*, + transform::prelude::*, utils::prelude::*, window::prelude::*, DefaultPlugins, MinimalPlugins, }; pub use bevy_derive::{bevy_main, Deref, DerefMut}; +#[doc(hidden)] +#[cfg(feature = "bevy_asset")] +pub use crate::asset::prelude::*; + #[doc(hidden)] #[cfg(feature = "bevy_audio")] pub use crate::audio::prelude::*; @@ -28,6 +31,10 @@ pub use crate::pbr::prelude::*; #[cfg(feature = "bevy_render")] pub use crate::render::prelude::*; +#[doc(hidden)] +#[cfg(feature = "bevy_scene")] +pub use crate::scene::prelude::*; + #[doc(hidden)] #[cfg(feature = "bevy_sprite")] pub use crate::sprite::prelude::*; diff --git a/docs/cargo_features.md b/docs/cargo_features.md index 728a19d6b7e26..8d0db4604380e 100644 --- a/docs/cargo_features.md +++ b/docs/cargo_features.md @@ -5,9 +5,11 @@ |feature name|description| |-|-| |animation|Animation support and glTF animation loading.| +|bevy_asset|Provides asset functionality for Bevy Engine.| |bevy_audio|Audio support. Support for all audio formats depends on this.| |bevy_gilrs|Adds gamepad support.| |bevy_gltf|[glTF](https://www.khronos.org/gltf/) support.| +|bevy_scene|Provides scene functionality for Bevy Engine.| |bevy_winit|GUI support.| |render|The render pipeline and all render related plugins.| |png|PNG picture format support.|