Проектная работа - WIP
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
use bevy::{app::FixedMain, prelude::*};
|
||||
use bevy::prelude::*;
|
||||
|
||||
fn main() {
|
||||
App::new() //
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_systems(StateTransition, state_transition)
|
||||
.add_systems(PreStartup, pre_startup)
|
||||
.add_systems(Startup, startup)
|
||||
.add_systems(Startup, (startup, setup))
|
||||
.add_systems(PostStartup, post_startup)
|
||||
.add_systems(First, first)
|
||||
.add_systems(PreUpdate, pre_update)
|
||||
.add_systems(FixedMain, fixed_main)
|
||||
.add_systems(Update, (update, check_space_pressed))
|
||||
.add_systems(PostUpdate, post_update)
|
||||
.run();
|
||||
}
|
||||
|
||||
@@ -37,6 +38,21 @@ fn pre_update() {
|
||||
info!("PreUpdate");
|
||||
}
|
||||
|
||||
fn fixed_main() {
|
||||
info!("FixedMain");
|
||||
fn update() {
|
||||
info!("Update");
|
||||
}
|
||||
|
||||
fn post_update() {
|
||||
info!("PostUpdate");
|
||||
}
|
||||
|
||||
fn check_space_pressed(input: Res<ButtonInput<KeyCode>>, mut commands: Commands) {
|
||||
if input.just_pressed(KeyCode::Space) {
|
||||
commands.trigger(TestEvent0);
|
||||
}
|
||||
}
|
||||
|
||||
fn setup(mut commands: Commands) {}
|
||||
|
||||
#[derive(Event)]
|
||||
struct TestEvent0;
|
||||
|
||||
Reference in New Issue
Block a user