Trait bevy::app::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/app/log_layers.rs (lines 35-39)
33
34
35
36
37
38
39
40
41
42
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(bevy::log::LogPlugin {
            custom_layer,

            ..default()
        }))
        .add_systems(Update, log_system)
        .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_ecs.rs (lines 95-98)
93
94
95
96
97
98
99
100
101
102
fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(bevy::log::LogPlugin {
            custom_layer,
            ..default()
        }))
        .add_systems(Startup, (log_system, setup))
        .add_systems(Update, print_logs)
        .run();
}
examples/3d/3d_shapes.rs (line 19)
16
17
18
19
20
21
22
23
24
25
fn main() {
    App::new()
        .add_plugins((
            DefaultPlugins.set(ImagePlugin::default_nearest()),
            WireframePlugin,
        ))
        .add_systems(Startup, setup)
        .add_systems(Update, (rotate, toggle_wireframe))
        .run();
}

Object Safety§

This trait is not object safe.

Implementors§