Make a plugin
This commit is contained in:
parent
f862cb7a62
commit
5bc2934672
15
src/main.rs
15
src/main.rs
@ -1,5 +1,16 @@
|
||||
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)]
|
||||
struct Person;
|
||||
|
||||
@ -28,8 +39,6 @@ fn gamarjoba() {
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_startup_system(add_people)
|
||||
.add_system(greetings)
|
||||
.add_system(gamarjoba)
|
||||
.add_plugin(GamarjobaPlugin)
|
||||
.run();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user