use bevy_app::{Plugin, PluginGroup, PluginGroupBuilder};
pub struct DefaultPlugins;
impl PluginGroup for DefaultPlugins {
fn build(self) -> PluginGroupBuilder {
let mut group = PluginGroupBuilder::start::<Self>();
group = group
.add(bevy_log::LogPlugin::default())
.add(bevy_core::TaskPoolPlugin::default())
.add(bevy_core::TypeRegistrationPlugin)
.add(bevy_core::FrameCountPlugin)
.add(bevy_time::TimePlugin)
.add(bevy_transform::TransformPlugin)
.add(bevy_hierarchy::HierarchyPlugin)
.add(bevy_diagnostic::DiagnosticsPlugin)
.add(bevy_input::InputPlugin)
.add(bevy_window::WindowPlugin::default())
.add(bevy_a11y::AccessibilityPlugin);
#[cfg(feature = "bevy_asset")]
{
group = group.add(bevy_asset::AssetPlugin::default());
}
#[cfg(feature = "bevy_scene")]
{
group = group.add(bevy_scene::ScenePlugin);
}
#[cfg(feature = "bevy_winit")]
{
group = group.add(bevy_winit::WinitPlugin::default());
}
#[cfg(feature = "bevy_render")]
{
group = group
.add(bevy_render::RenderPlugin::default())
.add(bevy_render::texture::ImagePlugin::default());
#[cfg(all(not(target_arch = "wasm32"), feature = "multi-threaded"))]
{
group = group.add(bevy_render::pipelined_rendering::PipelinedRenderingPlugin);
}
}
#[cfg(feature = "bevy_core_pipeline")]
{
group = group.add(bevy_core_pipeline::CorePipelinePlugin);
}
#[cfg(feature = "bevy_sprite")]
{
group = group.add(bevy_sprite::SpritePlugin);
}
#[cfg(feature = "bevy_text")]
{
group = group.add(bevy_text::TextPlugin);
}
#[cfg(feature = "bevy_ui")]
{
group = group.add(bevy_ui::UiPlugin);
}
#[cfg(feature = "bevy_pbr")]
{
group = group.add(bevy_pbr::PbrPlugin::default());
}
#[cfg(feature = "bevy_gltf")]
{
group = group.add(bevy_gltf::GltfPlugin::default());
}
#[cfg(feature = "bevy_audio")]
{
group = group.add(bevy_audio::AudioPlugin::default());
}
#[cfg(feature = "bevy_gilrs")]
{
group = group.add(bevy_gilrs::GilrsPlugin);
}
#[cfg(feature = "bevy_animation")]
{
group = group.add(bevy_animation::AnimationPlugin);
}
#[cfg(feature = "bevy_gizmos")]
{
group = group.add(bevy_gizmos::GizmoPlugin);
}
group = group.add(IgnoreAmbiguitiesPlugin);
group
}
}
struct IgnoreAmbiguitiesPlugin;
impl Plugin for IgnoreAmbiguitiesPlugin {
#[allow(unused_variables)] fn build(&self, app: &mut bevy_app::App) {
#[cfg(all(feature = "bevy_animation", feature = "bevy_ui"))]
app.ignore_ambiguity(
bevy_app::PostUpdate,
bevy_animation::animation_player,
bevy_ui::ui_layout_system,
);
#[cfg(feature = "bevy_render")]
if let Ok(render_app) = app.get_sub_app_mut(bevy_render::RenderApp) {
#[cfg(all(feature = "bevy_gizmos", feature = "bevy_sprite"))]
{
render_app.ignore_ambiguity(
bevy_render::Render,
bevy_gizmos::GizmoRenderSystem::QueueLineGizmos2d,
bevy_sprite::queue_sprites,
);
render_app.ignore_ambiguity(
bevy_render::Render,
bevy_gizmos::GizmoRenderSystem::QueueLineGizmos2d,
bevy_sprite::queue_material2d_meshes::<bevy_sprite::ColorMaterial>,
);
}
#[cfg(all(feature = "bevy_gizmos", feature = "bevy_pbr"))]
{
render_app.ignore_ambiguity(
bevy_render::Render,
bevy_gizmos::GizmoRenderSystem::QueueLineGizmos3d,
bevy_pbr::queue_material_meshes::<bevy_pbr::StandardMaterial>,
);
}
}
}
}
pub struct MinimalPlugins;
impl PluginGroup for MinimalPlugins {
fn build(self) -> PluginGroupBuilder {
PluginGroupBuilder::start::<Self>()
.add(bevy_core::TaskPoolPlugin::default())
.add(bevy_core::TypeRegistrationPlugin)
.add(bevy_core::FrameCountPlugin)
.add(bevy_time::TimePlugin)
.add(bevy_app::ScheduleRunnerPlugin::default())
}
}