Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/examples/ecs/startup_system.rs
6592 views
1
//! Demonstrates a startup system (one that runs once when the app starts up).
2
3
use bevy::prelude::*;
4
5
fn main() {
6
App::new()
7
.add_systems(Startup, startup_system)
8
.add_systems(Update, normal_system)
9
.run();
10
}
11
12
/// Startup systems are run exactly once when the app starts up.
13
/// They run right before "normal" systems run.
14
fn startup_system() {
15
println!("startup system ran first");
16
}
17
18
fn normal_system() {
19
println!("normal system ran second");
20
}
21
22