Trait bevy::prelude::PluginGroup

pub trait PluginGroup: Sized {
    // Required method
    fn build(self) -> PluginGroupBuilder;

    // Provided methods
    fn name() -> String { ... }
    fn set<T>(self, plugin: T) -> PluginGroupBuilder
       where T: Plugin { ... }
}
Expand description

Combines multiple Plugins into a single unit.

Required Methods§

fn build(self) -> PluginGroupBuilder

Configures the Plugins that are to be added.

Provided Methods§

fn name() -> String

Configures a name for the PluginGroup which is primarily used for debugging.

fn set<T>(self, plugin: T) -> PluginGroupBuilder
where T: Plugin,

Sets the value of the given Plugin, if it exists

Examples found in repository?
tests/3d/no_prepass.rs (lines 7-10)
5
6
7
8
9
10
11
12
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(PbrPlugin {
            prepass_enabled: false,
            ..default()
        }))
        .run();
}
More examples
Hide additional examples
examples/app/thread_pool_resources.rs (lines 8-10)
6
7
8
9
10
11
12
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(TaskPoolPlugin {
            task_pool_options: TaskPoolOptions::with_num_threads(4),
        }))
        .run();
}
examples/3d/3d_shapes.rs (line 17)
15
16
17
18
19
20
21
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
        .add_systems(Startup, setup)
        .add_systems(Update, rotate)
        .run();
}
examples/2d/sprite_sheet.rs (line 8)
6
7
8
9
10
11
12
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) // prevents blurry sprites
        .add_systems(Startup, setup)
        .add_systems(Update, animate_sprite)
        .run();
}
examples/shader/texture_binding_array.rs (line 23)
20
21
22
23
24
25
26
27
28
29
fn main() {
    let mut app = App::new();
    app.add_plugins((
        DefaultPlugins.set(ImagePlugin::default_nearest()),
        GpuFeatureSupportChecker,
        MaterialPlugin::<BindlessMaterial>::default(),
    ))
    .add_systems(Startup, setup)
    .run();
}
examples/2d/pixel_grid_snap.rs (line 31)
29
30
31
32
33
34
35
36
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
        .insert_resource(Msaa::Off)
        .add_systems(Startup, (setup_camera, setup_sprite, setup_mesh))
        .add_systems(Update, (rotate, fit_canvas))
        .run();
}

Object Safety§

This trait is not object safe.

Implementors§