mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
22 lines
588 B
Rust
22 lines
588 B
Rust
use bevy::{
|
|
app::schedule_runner::ScheduleRunnerPlugin,
|
|
prelude::*,
|
|
};
|
|
|
|
fn main() {
|
|
App::build()
|
|
.add_plugin(ScheduleRunnerPlugin::run_once()) // only run the app once so the printed system order is clearer
|
|
.add_startup_system(startup_system.system())
|
|
.add_system(normal_system.system())
|
|
.run();
|
|
}
|
|
|
|
/// Startup systems are run exactly once when the app starts up.
|
|
/// They run right before "normal" systems run.
|
|
fn startup_system() {
|
|
println!("startup system ran first");
|
|
}
|
|
|
|
fn normal_system() {
|
|
println!("normal system ran second");
|
|
}
|