//! Demonstrates the creation and registration of a custom plugin group.1//! [`PluginGroup`]s are a way to group sets of plugins that should be registered together.23use bevy::{app::PluginGroupBuilder, prelude::*};45fn main() {6App::new()7.add_plugins((8// Two PluginGroups that are included with bevy are DefaultPlugins and MinimalPlugins9DefaultPlugins,10// Adding a plugin group adds all plugins in the group by default11HelloWorldPlugins,12))13// You can also modify a PluginGroup (such as disabling plugins) like this:14// .add_plugins(15// HelloWorldPlugins16// .build()17// .disable::<PrintWorldPlugin>()18// .add_before::<PrintHelloPlugin>(19// bevy::diagnostic::LogDiagnosticsPlugin::default(),20// ),21// )22.run();23}2425/// A group of plugins that produce the "hello world" behavior26pub struct HelloWorldPlugins;2728impl PluginGroup for HelloWorldPlugins {29fn build(self) -> PluginGroupBuilder {30PluginGroupBuilder::start::<Self>()31.add(PrintHelloPlugin)32.add(PrintWorldPlugin)33}34}3536struct PrintHelloPlugin;3738impl Plugin for PrintHelloPlugin {39fn build(&self, app: &mut App) {40app.add_systems(Update, print_hello_system);41}42}4344fn print_hello_system() {45info!("hello");46}4748struct PrintWorldPlugin;4950impl Plugin for PrintWorldPlugin {51fn build(&self, app: &mut App) {52app.add_systems(Update, print_world_system);53}54}5556fn print_world_system() {57info!("world");58}596061