mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-29 22:57:00 +00:00
528e13a250
* feat(bevy_gltf_components): * create crate * added SystemSet (GltfComponentsSet) to run process_loaded_scenes (where components are injected) in a specific systemset & allow ordering other systems relative to it * feat(bevy_gltf_blueprints): * created crate * made the blueprint library path configurable * added BluePrintBundle helper * added SystemSet (GltfBlueprintsSet) for better system ordering * integrated into advanced demo * feat(tools-blender-auto-export): * renamed blender tool to gltf_auto_export * rewritten auto_export * added blueprint / prefab support * creates scene with empties with BlueprintName components in the scene * export of the main scene now exports this scene instead of real main scene * changes collection stand in names in original scene & sets them back after export to have correctly named collection instance exports * also added an additional 'SpawnHere' component to not conflate BlueprintNames & spawning requests * toggling & blueprint library output parameters added * added correct handling/ restoring of saved selection when using blueprints * feat(examples): * added advanced example * general example renamed to "basic", and cleaned up * feat(various): a lot of experiments with saving & loading etc * chore(assets): updated blend & generated assets * fix(examples-advanced): disabling hot reloading as it messes up scenes in experiments with save & loading * docs(): * added & fleshing out docs for the various crates & main README * added process doc image & tweaks to README * added missing licence info where relevant * fixed broken links * clarified some aspects * added updated screenshots where relevant * added tweaks & improvements etc
58 lines
1.1 KiB
Rust
58 lines
1.1 KiB
Rust
use bevy::prelude::*;
|
|
use bevy::app::AppExit;
|
|
|
|
#[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>()
|
|
;
|
|
}
|
|
} |