State+Scene Transititions
This commit is contained in:
@@ -8,8 +8,8 @@ use crate::{
|
||||
states::{
|
||||
game::*,
|
||||
input::{InputState, PlayerState},
|
||||
loading::{AssetLoadingState, StartupLoadingState},
|
||||
menu::MenuState,
|
||||
play::PlayStartupSystems,
|
||||
},
|
||||
};
|
||||
use bevy::{
|
||||
@@ -24,22 +24,11 @@ pub struct GamePlugin;
|
||||
|
||||
impl Plugin for GamePlugin {
|
||||
fn build(&self, app: &mut bevy::app::App) {
|
||||
app.init_state::<AssetLoadingState>();
|
||||
app.init_state::<StartupLoadingState>();
|
||||
app.insert_state(GameState::Startup);
|
||||
app.init_state::<MenuState>();
|
||||
app.init_state::<PlayerState>();
|
||||
app.add_loading_state(
|
||||
LoadingState::new(AssetLoadingState::Loading).continue_to_state(AssetLoadingState::Finalizing),
|
||||
)
|
||||
.add_loading_state(
|
||||
LoadingState::new(StartupLoadingState::Loading).continue_to_state(StartupLoadingState::Finalizing),
|
||||
);
|
||||
|
||||
app.add_plugins((
|
||||
FollowCamPlugin,
|
||||
CameraPlugin,
|
||||
StateManagementPlugin,
|
||||
MainMenuPlugin,
|
||||
// ShipPlugin,
|
||||
TypesPlugin,
|
||||
PlayerPlugin,
|
||||
@@ -49,7 +38,7 @@ impl Plugin for GamePlugin {
|
||||
#[cfg(feature = "dev-phys")]
|
||||
RapierDebugRenderPlugin::default(),
|
||||
));
|
||||
app.add_systems(Startup, (setup_scene, spawn_ship).chain());
|
||||
app.add_systems(Update, (setup_scene, spawn_ship).chain().in_set(PlayStartupSystems));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user