Trait bevy::prelude::PluginGroup

source ·
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§

source

fn build(self) -> PluginGroupBuilder

Configures the Plugins that are to be added.

Provided Methods§

source

fn name() -> String

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

source

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 16)
14
15
16
17
18
19
20
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/app/log_layers.rs (lines 31-34)
29
30
31
32
33
34
35
36
37
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(bevy::log::LogPlugin {
            update_subscriber: Some(update_subscriber),
            ..default()
        }))
        .add_systems(Update, log_system)
        .run();
}
examples/shader/texture_binding_array.rs (line 17)
14
15
16
17
18
19
20
21
22
23
fn main() {
    let mut app = App::new();
    app.add_plugins((
        DefaultPlugins.set(ImagePlugin::default_nearest()),
        GpuFeatureSupportChecker,
        MaterialPlugin::<BindlessMaterial>::default(),
    ))
    .add_systems(Startup, setup)
    .run();
}

Object Safety§

This trait is not object safe.

Implementors§