Make a plugin

This commit is contained in:
Greg Shuflin 2023-03-18 13:46:16 -07:00
parent f862cb7a62
commit 5bc2934672

View File

@ -1,5 +1,16 @@
use bevy::prelude::*; use bevy::prelude::*;
pub struct GamarjobaPlugin;
impl Plugin for GamarjobaPlugin {
fn build(&self, app: &mut App) {
app.add_startup_system(add_people)
.add_system(gamarjoba)
.add_system(greetings);
}
}
#[derive(Component)] #[derive(Component)]
struct Person; struct Person;
@ -28,8 +39,6 @@ fn gamarjoba() {
fn main() { fn main() {
App::new() App::new()
.add_plugins(DefaultPlugins) .add_plugins(DefaultPlugins)
.add_startup_system(add_people) .add_plugin(GamarjobaPlugin)
.add_system(greetings)
.add_system(gamarjoba)
.run(); .run();
} }