2020-10-29 20:04:28 +00:00
|
|
|
use bevy_app::{PluginGroup, PluginGroupBuilder};
|
|
|
|
|
2021-04-22 23:30:48 +00:00
|
|
|
use bevy_app::ScheduleRunnerPlugin;
|
|
|
|
use bevy_asset::AssetPlugin;
|
|
|
|
#[cfg(feature = "bevy_audio")]
|
|
|
|
use bevy_audio::AudioPlugin;
|
|
|
|
use bevy_core::CorePlugin;
|
|
|
|
use bevy_diagnostic::DiagnosticsPlugin;
|
|
|
|
#[cfg(feature = "bevy_gilrs")]
|
|
|
|
use bevy_gilrs::GilrsPlugin;
|
|
|
|
#[cfg(feature = "bevy_gltf")]
|
|
|
|
use bevy_gltf::GltfPlugin;
|
|
|
|
use bevy_input::InputPlugin;
|
|
|
|
use bevy_log::LogPlugin;
|
|
|
|
#[cfg(feature = "bevy_pbr")]
|
|
|
|
use bevy_pbr::PbrPlugin;
|
|
|
|
#[cfg(feature = "bevy_render")]
|
|
|
|
use bevy_render::RenderPlugin;
|
|
|
|
use bevy_scene::ScenePlugin;
|
|
|
|
#[cfg(feature = "bevy_sprite")]
|
|
|
|
use bevy_sprite::SpritePlugin;
|
|
|
|
#[cfg(feature = "bevy_text")]
|
|
|
|
use bevy_text::TextPlugin;
|
|
|
|
use bevy_transform::TransformPlugin;
|
|
|
|
#[cfg(feature = "bevy_ui")]
|
|
|
|
use bevy_ui::UiPlugin;
|
|
|
|
#[cfg(feature = "bevy_wgpu")]
|
|
|
|
use bevy_wgpu::WgpuPlugin;
|
|
|
|
use bevy_window::WindowPlugin;
|
|
|
|
#[cfg(feature = "bevy_winit")]
|
|
|
|
use bevy_winit::WinitPlugin;
|
|
|
|
|
|
|
|
/// This plugin group will add all the default plugins:
|
|
|
|
/// * [`LogPlugin`]
|
|
|
|
/// * [`CorePlugin`]
|
|
|
|
/// * [`TransformPlugin`]
|
|
|
|
/// * [`DiagnosticsPlugin`]
|
|
|
|
/// * [`InputPlugin`]
|
|
|
|
/// * [`WindowPlugin`]
|
|
|
|
/// * [`AssetPlugin`]
|
|
|
|
/// * [`ScenePlugin`]
|
|
|
|
/// * [`RenderPlugin`] - with feature `bevy_render`
|
|
|
|
/// * [`SpritePlugin`] - with feature `bevy_sprite`
|
|
|
|
/// * [`PbrPlugin`] - with feature `bevy_pbr`
|
|
|
|
/// * [`UiPlugin`] - with feature `bevy_ui`
|
|
|
|
/// * [`TextPlugin`] - with feature `bevy_text`
|
|
|
|
/// * [`AudioPlugin`] - with feature `bevy_audio`
|
|
|
|
/// * [`GilrsPlugin`] - with feature `bevy_gilrs`
|
|
|
|
/// * [`GltfPlugin`] - with feature `bevy_gltf`
|
|
|
|
/// * [`WinitPlugin`] - with feature `bevy_winit`
|
|
|
|
/// * [`WgpuPlugin`] - with feature `bevy_wgpu`
|
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-04-22 23:30:48 +00:00
|
|
|
group.add(LogPlugin::default());
|
|
|
|
group.add(CorePlugin::default());
|
|
|
|
group.add(TransformPlugin::default());
|
|
|
|
group.add(DiagnosticsPlugin::default());
|
|
|
|
group.add(InputPlugin::default());
|
|
|
|
group.add(WindowPlugin::default());
|
|
|
|
group.add(AssetPlugin::default());
|
|
|
|
group.add(ScenePlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_render")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(RenderPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_sprite")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(SpritePlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_pbr")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(PbrPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_ui")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(UiPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_text")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(TextPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_audio")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(AudioPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_gilrs")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(GilrsPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_gltf")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(GltfPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_winit")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(WinitPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_wgpu")]
|
2021-04-22 23:30:48 +00:00
|
|
|
group.add(WgpuPlugin::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:
|
|
|
|
/// * [`CorePlugin`]
|
|
|
|
/// * [`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-22 23:30:48 +00:00
|
|
|
group.add(CorePlugin::default());
|
|
|
|
group.add(ScheduleRunnerPlugin::default());
|
2020-10-29 20:04:28 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-11 20:13:07 +00:00
|
|
|
|
|
|
|
pub struct PipelinedDefaultPlugins;
|
|
|
|
|
|
|
|
impl PluginGroup for PipelinedDefaultPlugins {
|
|
|
|
fn build(&mut self, group: &mut PluginGroupBuilder) {
|
|
|
|
group.add(bevy_log::LogPlugin::default());
|
|
|
|
group.add(bevy_core::CorePlugin::default());
|
|
|
|
group.add(bevy_transform::TransformPlugin::default());
|
|
|
|
group.add(bevy_diagnostic::DiagnosticsPlugin::default());
|
|
|
|
group.add(bevy_input::InputPlugin::default());
|
|
|
|
group.add(bevy_window::WindowPlugin::default());
|
|
|
|
group.add(bevy_asset::AssetPlugin::default());
|
2021-07-30 03:37:34 +00:00
|
|
|
group.add(bevy_scene::ScenePlugin::default());
|
2021-04-11 20:13:07 +00:00
|
|
|
|
2021-10-29 00:46:18 +00:00
|
|
|
#[cfg(feature = "bevy_winit")]
|
|
|
|
group.add(bevy_winit::WinitPlugin::default());
|
|
|
|
|
2021-04-11 20:13:07 +00:00
|
|
|
#[cfg(feature = "bevy_render2")]
|
2021-06-02 02:59:17 +00:00
|
|
|
{
|
|
|
|
group.add(bevy_render2::RenderPlugin::default());
|
|
|
|
}
|
2021-04-11 20:13:07 +00:00
|
|
|
|
2021-07-28 21:29:32 +00:00
|
|
|
#[cfg(feature = "bevy_core_pipeline")]
|
|
|
|
{
|
|
|
|
group.add(bevy_core_pipeline::CorePipelinePlugin::default());
|
2021-04-11 20:13:07 +00:00
|
|
|
|
2021-07-28 21:29:32 +00:00
|
|
|
#[cfg(feature = "bevy_sprite2")]
|
|
|
|
group.add(bevy_sprite2::SpritePlugin::default());
|
2021-06-02 02:59:17 +00:00
|
|
|
|
2021-12-10 22:21:23 +00:00
|
|
|
#[cfg(feature = "bevy_text2")]
|
|
|
|
group.add(bevy_text2::TextPlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "bevy_ui2")]
|
|
|
|
group.add(bevy_ui2::UiPlugin::default());
|
|
|
|
|
2021-07-28 21:29:32 +00:00
|
|
|
#[cfg(feature = "bevy_pbr2")]
|
|
|
|
group.add(bevy_pbr2::PbrPlugin::default());
|
2021-07-30 03:37:34 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "bevy_gltf2")]
|
|
|
|
group.add(bevy_gltf2::GltfPlugin::default());
|
2021-07-28 21:29:32 +00:00
|
|
|
}
|
2021-04-11 20:13:07 +00:00
|
|
|
}
|
|
|
|
}
|