use bevy::{app::PluginGroupBuilder, prelude::*};
fn main() {
App::new()
.add_plugins((
DefaultPlugins,
HelloWorldPlugins,
))
.run();
}
pub struct HelloWorldPlugins;
impl PluginGroup for HelloWorldPlugins {
fn build(self) -> PluginGroupBuilder {
PluginGroupBuilder::start::<Self>()
.add(PrintHelloPlugin)
.add(PrintWorldPlugin)
}
}
struct PrintHelloPlugin;
impl Plugin for PrintHelloPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, print_hello_system);
}
}
fn print_hello_system() {
info!("hello");
}
struct PrintWorldPlugin;
impl Plugin for PrintWorldPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, print_world_system);
}
}
fn print_world_system() {
info!("world");
}