mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 20:00:53 +00:00
4afa0f5d7d
* feat(animation): added example & boilerplate * moved animations specific code to a different module * added multiple robots & foxes * added example of controlling animation based on distance from the player * removed obsolete files * added information about animation to READMEs * updated dependencies closes #26
55 lines
1.1 KiB
Rust
55 lines
1.1 KiB
Rust
use bevy::app::AppExit;
|
|
use bevy::prelude::*;
|
|
|
|
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Default, States)]
|
|
pub enum AppState {
|
|
#[default]
|
|
CoreLoading,
|
|
MenuRunning,
|
|
AppLoading,
|
|
AppRunning,
|
|
AppEnding,
|
|
|
|
// FIXME: not sure
|
|
LoadingGame,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Default, States)]
|
|
pub enum GameState {
|
|
#[default]
|
|
None,
|
|
|
|
InMenu,
|
|
InGame,
|
|
|
|
InGameOver,
|
|
|
|
InSaving,
|
|
InLoading,
|
|
}
|
|
|
|
// tag components for all entities within a certain state (for despawning them if needed) , FIXME: seems kinda hack-ish
|
|
#[derive(Component)]
|
|
pub struct InCoreLoading;
|
|
#[derive(Component, Default)]
|
|
pub struct InMenuRunning;
|
|
#[derive(Component)]
|
|
pub struct InAppLoading;
|
|
#[derive(Component)]
|
|
pub struct InAppRunning;
|
|
|
|
// components for tagging in game vs in game menu stuff
|
|
#[derive(Component, Default)]
|
|
pub struct InMainMenu;
|
|
#[derive(Component, Default)]
|
|
pub struct InMenu;
|
|
#[derive(Component, Default)]
|
|
pub struct InGame;
|
|
|
|
pub struct StatePlugin;
|
|
impl Plugin for StatePlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.add_state::<AppState>().add_state::<GameState>();
|
|
}
|
|
}
|