2020-10-29 20:04:28 +00:00
|
|
|
use bevy_app::{PluginGroup, PluginGroupBuilder};
|
|
|
|
|
2021-04-22 23:30:48 +00:00
|
|
|
/// This plugin group will add all the default plugins:
|
2021-12-18 00:09:23 +00:00
|
|
|
/// * [`LogPlugin`](bevy_log::LogPlugin)
|
|
|
|
/// * [`CorePlugin`](bevy_core::CorePlugin)
|
2022-05-26 00:27:18 +00:00
|
|
|
/// * [`TimePlugin`](bevy_time::TimePlugin)
|
2021-12-18 00:09:23 +00:00
|
|
|
/// * [`TransformPlugin`](bevy_transform::TransformPlugin)
|
2022-03-15 01:54:05 +00:00
|
|
|
/// * [`HierarchyPlugin`](bevy_hierarchy::HierarchyPlugin)
|
2021-12-18 00:09:23 +00:00
|
|
|
/// * [`DiagnosticsPlugin`](bevy_diagnostic::DiagnosticsPlugin)
|
|
|
|
/// * [`InputPlugin`](bevy_input::InputPlugin)
|
|
|
|
/// * [`WindowPlugin`](bevy_window::WindowPlugin)
|
|
|
|
/// * [`AssetPlugin`](bevy_asset::AssetPlugin)
|
|
|
|
/// * [`ScenePlugin`](bevy_scene::ScenePlugin)
|
|
|
|
/// * [`RenderPlugin`](bevy_render::RenderPlugin) - with feature `bevy_render`
|
|
|
|
/// * [`SpritePlugin`](bevy_sprite::SpritePlugin) - with feature `bevy_sprite`
|
|
|
|
/// * [`PbrPlugin`](bevy_pbr::PbrPlugin) - with feature `bevy_pbr`
|
|
|
|
/// * [`UiPlugin`](bevy_ui::UiPlugin) - with feature `bevy_ui`
|
|
|
|
/// * [`TextPlugin`](bevy_text::TextPlugin) - with feature `bevy_text`
|
|
|
|
/// * [`AudioPlugin`](bevy_audio::AudioPlugin) - with feature `bevy_audio`
|
|
|
|
/// * [`GilrsPlugin`](bevy_gilrs::GilrsPlugin) - with feature `bevy_gilrs`
|
|
|
|
/// * [`GltfPlugin`](bevy_gltf::GltfPlugin) - with feature `bevy_gltf`
|
|
|
|
/// * [`WinitPlugin`](bevy_winit::WinitPlugin) - with feature `bevy_winit`
|
2021-08-10 23:46:39 +00:00
|
|
|
///
|
|
|
|
/// See also [`MinimalPlugins`] for a slimmed down option
|
2020-10-29 20:04:28 +00:00
|
|
|
pub struct DefaultPlugins;
|
|
|
|
|
|
|
|
impl PluginGroup for DefaultPlugins {
|
|
|
|
fn build(&mut self, group: &mut PluginGroupBuilder) {
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_log::LogPlugin::default());
|
|
|
|
group.add(bevy_core::CorePlugin::default());
|
2022-05-26 00:27:18 +00:00
|
|
|
group.add(bevy_time::TimePlugin::default());
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_transform::TransformPlugin::default());
|
2022-03-15 01:54:05 +00:00
|
|
|
group.add(bevy_hierarchy::HierarchyPlugin::default());
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_diagnostic::DiagnosticsPlugin::default());
|
|
|
|
group.add(bevy_input::InputPlugin::default());
|
|
|
|
group.add(bevy_window::WindowPlugin::default());
|
|
|
|
group.add(bevy_asset::AssetPlugin::default());
|
2022-02-18 22:56:57 +00:00
|
|
|
#[cfg(feature = "debug_asset_server")]
|
|
|
|
group.add(bevy_asset::debug_asset_server::DebugAssetServerPlugin::default());
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_scene::ScenePlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_winit")]
|
|
|
|
group.add(bevy_winit::WinitPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_render")]
|
|
|
|
group.add(bevy_render::RenderPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_core_pipeline")]
|
|
|
|
group.add(bevy_core_pipeline::CorePipelinePlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_sprite")]
|
|
|
|
group.add(bevy_sprite::SpritePlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_text")]
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_text::TextPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_ui")]
|
|
|
|
group.add(bevy_ui::UiPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_pbr")]
|
|
|
|
group.add(bevy_pbr::PbrPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2022-03-15 22:26:46 +00:00
|
|
|
// NOTE: Load this after renderer initialization so that it knows about the supported
|
|
|
|
// compressed texture formats
|
2020-10-29 20:04:28 +00:00
|
|
|
#[cfg(feature = "bevy_gltf")]
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_gltf::GltfPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2021-12-14 03:58:23 +00:00
|
|
|
#[cfg(feature = "bevy_audio")]
|
|
|
|
group.add(bevy_audio::AudioPlugin::default());
|
2021-12-18 00:09:23 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_gilrs")]
|
|
|
|
group.add(bevy_gilrs::GilrsPlugin::default());
|
2022-04-02 22:36:02 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_animation")]
|
|
|
|
group.add(bevy_animation::AnimationPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-22 23:30:48 +00:00
|
|
|
/// Minimal plugin group that will add the following plugins:
|
2021-12-18 00:09:23 +00:00
|
|
|
/// * [`CorePlugin`](bevy_core::CorePlugin)
|
2022-05-26 00:27:18 +00:00
|
|
|
/// * [`TimePlugin`](bevy_time::TimePlugin)
|
2021-12-18 00:09:23 +00:00
|
|
|
/// * [`ScheduleRunnerPlugin`](bevy_app::ScheduleRunnerPlugin)
|
2021-08-10 23:46:39 +00:00
|
|
|
///
|
|
|
|
/// See also [`DefaultPlugins`] for a more complete set of plugins
|
2020-11-03 02:38:37 +00:00
|
|
|
pub struct MinimalPlugins;
|
2020-10-29 20:04:28 +00:00
|
|
|
|
2020-11-03 02:38:37 +00:00
|
|
|
impl PluginGroup for MinimalPlugins {
|
|
|
|
fn build(&mut self, group: &mut PluginGroupBuilder) {
|
2021-04-11 20:13:07 +00:00
|
|
|
group.add(bevy_core::CorePlugin::default());
|
2022-05-26 00:27:18 +00:00
|
|
|
group.add(bevy_time::TimePlugin::default());
|
2021-12-14 03:58:23 +00:00
|
|
|
group.add(bevy_app::ScheduleRunnerPlugin::default());
|
2021-04-11 20:13:07 +00:00
|
|
|
}
|
|
|
|
}
|