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::*;
|
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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user