2020-04-19 19:13:04 +00:00
|
|
|
use crate::app::AppBuilder;
|
|
|
|
|
|
|
|
pub trait AddDefaultPlugins {
|
|
|
|
fn add_default_plugins(&mut self) -> &mut Self;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl AddDefaultPlugins for AppBuilder {
|
|
|
|
fn add_default_plugins(&mut self) -> &mut Self {
|
|
|
|
#[cfg(feature = "core")]
|
|
|
|
self.add_plugin(bevy_core::CorePlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "input")]
|
|
|
|
self.add_plugin(bevy_input::InputPlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "window")]
|
|
|
|
self.add_plugin(bevy_window::WindowPlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "render")]
|
|
|
|
self.add_plugin(bevy_render::RenderPlugin::default());
|
|
|
|
|
2020-04-25 00:46:54 +00:00
|
|
|
#[cfg(feature = "pbr")]
|
|
|
|
self.add_plugin(bevy_pbr::PbrPlugin::default());
|
|
|
|
|
2020-04-19 19:13:04 +00:00
|
|
|
#[cfg(feature = "ui")]
|
|
|
|
self.add_plugin(bevy_ui::UiPlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "winit")]
|
|
|
|
self.add_plugin(bevy_winit::WinitPlugin::default());
|
|
|
|
#[cfg(not(feature = "winit"))]
|
|
|
|
self.add_plugin(bevy_app::schedule_runner::ScheduleRunnerPlugin::default());
|
|
|
|
|
|
|
|
#[cfg(feature = "wgpu")]
|
|
|
|
self.add_plugin(bevy_wgpu::WgpuPlugin::default());
|
|
|
|
|
|
|
|
self
|
|
|
|
}
|
2020-04-25 01:55:15 +00:00
|
|
|
}
|