mirror of
https://github.com/bevyengine/bevy
synced 2024-11-14 08:58:04 +00:00
aefe1f0739
Co-authored-by: Mike <mike.hsu@gmail.com>
20 lines
484 B
Rust
20 lines
484 B
Rust
//! Demonstrates a startup system (one that runs once when the app starts up).
|
|
|
|
use bevy::prelude::*;
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_systems(Startup, startup_system)
|
|
.add_systems(Update, normal_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");
|
|
}
|