bevy/src/add_default_plugins.rs

56 lines
1.7 KiB
Rust
Raw Normal View History

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());
2020-05-06 01:44:32 +00:00
2020-05-04 20:42:49 +00:00
#[cfg(feature = "diagnostic")]
self.add_plugin(bevy_diagnostic::DiagnosticsPlugin::default());
2020-04-19 19:13:04 +00:00
2020-05-22 00:21:33 +00:00
#[cfg(feature = "scene")]
self.add_plugin(bevy_scene::ComponentRegistryPlugin::default());
2020-04-19 19:13:04 +00:00
#[cfg(feature = "input")]
self.add_plugin(bevy_input::InputPlugin::default());
#[cfg(feature = "window")]
self.add_plugin(bevy_window::WindowPlugin::default());
#[cfg(feature = "asset")]
self.add_plugin(bevy_asset::AssetPlugin::default());
2020-05-22 00:21:33 +00:00
#[cfg(feature = "scene")]
self.add_plugin(bevy_scene::ScenePlugin::default());
2020-04-19 19:13:04 +00:00
#[cfg(feature = "render")]
self.add_plugin(bevy_render::RenderPlugin::default());
#[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 = "gltf")]
self.add_plugin(bevy_gltf::GltfPlugin::default());
2020-05-16 02:46:09 +00:00
#[cfg(feature = "text")]
self.add_plugin(bevy_text::TextPlugin::default());
2020-04-19 19:13:04 +00:00
#[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
}