diff --git a/examples/blenvy/blueprints/art/blueprints.blend b/examples/blenvy/blueprints/art/basic.blend similarity index 100% rename from examples/blenvy/blueprints/art/blueprints.blend rename to examples/blenvy/blueprints/art/basic.blend diff --git a/examples/common/Cargo.toml b/examples/common/Cargo.toml deleted file mode 100644 index 2951869..0000000 --- a/examples/common/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "bevy_gltf_worlflow_examples_common" -version = "0.1.0" -edition = "2021" -license = "MIT OR Apache-2.0" - -[features] -blueprints = ["dep:bevy_gltf_blueprints"] -physics_rapier = ["dep:bevy_rapier3d"] -physics_xpbd = ["dep:bevy_xpbd_3d"] -default = ["blueprints", "physics_rapier"] - - -[dependencies] -bevy = { version = "0.13", features = ["dynamic_linking"] } -bevy_gltf_blueprints = { path = "../../crates/bevy_gltf_blueprints", optional = true } -bevy_rapier3d = { version = "0.25", features = ["serde-serialize", "debug-render-3d", "enhanced-determinism"], optional = true } -bevy_xpbd_3d = { version = "0.4", optional = true } -bevy_asset_loader = { version = "0.20", features = ["standard_dynamic_assets"] } -bevy_editor_pls = { version = "0.8" } -rand = "0.8.5" diff --git a/examples/common/src/assets/assets_core.rs b/examples/common/src/assets/assets_core.rs deleted file mode 100644 index 29b577a..0000000 --- a/examples/common/src/assets/assets_core.rs +++ /dev/null @@ -1,5 +0,0 @@ -use bevy::prelude::*; -use bevy_asset_loader::prelude::*; - -#[derive(AssetCollection, Resource)] -pub struct CoreAssets {} diff --git a/examples/common/src/assets/assets_game.rs b/examples/common/src/assets/assets_game.rs deleted file mode 100644 index 5bb5986..0000000 --- a/examples/common/src/assets/assets_game.rs +++ /dev/null @@ -1,24 +0,0 @@ -use bevy::gltf::Gltf; -use bevy::prelude::*; -use bevy::utils::HashMap; -use bevy_asset_loader::prelude::*; - -#[derive(AssetCollection, Resource)] -pub struct GameAssets { - #[asset(key = "world", optional)] - pub world: Option>, - - #[asset(key = "world_dynamic", optional)] - pub world_dynamic: Option>, - - #[asset(key = "level1", optional)] - pub level1: Option>, - #[asset(key = "level2", optional)] - pub level2: Option>, - - #[asset(key = "models", collection(typed, mapped), optional)] - pub models: Option>>, - - #[asset(key = "materials", collection(typed, mapped), optional)] - pub materials: Option>>, -} diff --git a/examples/common/src/assets/mod.rs b/examples/common/src/assets/mod.rs deleted file mode 100644 index 7034ca6..0000000 --- a/examples/common/src/assets/mod.rs +++ /dev/null @@ -1,35 +0,0 @@ -pub mod assets_core; -pub use assets_core::*; - -pub mod assets_game; -pub use assets_game::*; - -use bevy::prelude::*; -use bevy_asset_loader::prelude::*; - -use crate::state::AppState; - -pub struct AssetsPlugin; -impl Plugin for AssetsPlugin { - fn build(&self, app: &mut App) { - app - // load core assets (ie assets needed in the main menu, and everywhere else before loading more assets in game) - .add_loading_state( - LoadingState::new(AppState::CoreLoading) - .continue_to_state(AppState::MenuRunning) - .with_dynamic_assets_file::( - "assets_core.assets.ron", - ) - .load_collection::(), - ) - // load game assets - .add_loading_state( - LoadingState::new(AppState::AppLoading) - .continue_to_state(AppState::AppRunning) - .with_dynamic_assets_file::( - "assets_game.assets.ron", - ) - .load_collection::(), - ); - } -} diff --git a/examples/common/src/core/mod.rs b/examples/common/src/core/mod.rs deleted file mode 100644 index 4d8dde2..0000000 --- a/examples/common/src/core/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub mod camera; -pub use camera::*; - -//pub mod relationships; -//pub use relationships::*; - -use bevy::prelude::*; - -pub struct CorePlugin; -impl Plugin for CorePlugin { - fn build(&self, app: &mut App) { - app.add_plugins(CameraPlugin); - } -} diff --git a/examples/common/src/game/mod.rs b/examples/common/src/game/mod.rs deleted file mode 100644 index 50dab57..0000000 --- a/examples/common/src/game/mod.rs +++ /dev/null @@ -1,36 +0,0 @@ -/*pub mod in_game; -pub use in_game::*; - -pub mod in_main_menu; -pub use in_main_menu::*;*/ - -pub mod player; -pub use player::*; - -pub mod picking; -pub use picking::*; - -/* -use crate::{ - state::{AppState, GameState}, -};*/ -use bevy::prelude::*; - -pub struct GamePlugin; -impl Plugin for GamePlugin { - fn build(&self, app: &mut App) { - app.add_plugins(( - PlayerPlugin, - PickingPlugin - )) - /* .register_type::() - .register_type::() - .register_type::() - - .add_systems(OnEnter(AppState::MenuRunning), setup_main_menu) - .add_systems(OnExit(AppState::MenuRunning), teardown_main_menu) - .add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning))) - .add_systems(OnEnter(AppState::AppRunning), setup_game);*/ - ; - } -} diff --git a/examples/common/src/lib.rs b/examples/common/src/lib.rs deleted file mode 100644 index 289f9af..0000000 --- a/examples/common/src/lib.rs +++ /dev/null @@ -1,27 +0,0 @@ -pub mod state; -pub use state::*; - -pub mod assets; -use assets::*; - -pub mod core; -pub use core::*; - -pub mod game; -pub use game::*; - -use bevy::prelude::*; -use bevy_editor_pls::prelude::*; - -pub struct CommonPlugin; -impl Plugin for CommonPlugin { - fn build(&self, app: &mut App) { - app.add_plugins(( - StatePlugin, - AssetsPlugin, - CorePlugin, - GamePlugin, - EditorPlugin::default(), - )); - } -} diff --git a/examples/common_rapier/Cargo.toml b/examples/common_rapier/Cargo.toml deleted file mode 100644 index 5289163..0000000 --- a/examples/common_rapier/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "bevy_gltf_worlflow_examples_common_rapier" -version = "0.1.0" -edition = "2021" -license = "MIT OR Apache-2.0" - -[features] -blueprints = ["dep:bevy_gltf_blueprints"] -default = ["blueprints"] - - -[dependencies] -bevy = { version = "0.13", features = ["dynamic_linking"] } -bevy_gltf_worlflow_examples_common = { path = "../common" } -bevy_gltf_blueprints = { path = "../../crates/bevy_gltf_blueprints", optional = true } -bevy_rapier3d = { version = "0.25", features = ["serde-serialize", "debug-render-3d", "enhanced-determinism"] } -bevy_asset_loader = { version = "0.20", features = ["standard_dynamic_assets"] } -bevy_editor_pls = { version = "0.8" } -rand = "0.8.5" diff --git a/examples/common_rapier/src/lib.rs b/examples/common_rapier/src/lib.rs deleted file mode 100644 index 0df818d..0000000 --- a/examples/common_rapier/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_worlflow_examples_common::CommonPlugin as CommonBasePlugin; - -pub use bevy_gltf_worlflow_examples_common::*; - -mod physics; - -pub struct CommonPlugin; -impl Plugin for CommonPlugin { - fn build(&self, app: &mut App) { - app.add_plugins((physics::plugin, CommonBasePlugin)); - } -} diff --git a/examples/common_xpbd/Cargo.toml b/examples/common_xpbd/Cargo.toml deleted file mode 100644 index 2582a73..0000000 --- a/examples/common_xpbd/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "bevy_gltf_worlflow_examples_common_xpbd" -version = "0.1.0" -edition = "2021" -license = "MIT OR Apache-2.0" - -[features] -blueprints = ["dep:bevy_gltf_blueprints"] -default = ["blueprints"] - - -[dependencies] -bevy = { version = "0.13", features = ["dynamic_linking"] } -bevy_gltf_worlflow_examples_common = { path = "../common" } -bevy_gltf_blueprints = { path = "../../crates/bevy_gltf_blueprints", optional = true } -bevy_xpbd_3d = { version = "0.4" } -bevy_asset_loader = { version = "0.20", features = ["standard_dynamic_assets"] } -bevy_editor_pls = { version = "0.8" } -rand = "0.8.5" diff --git a/examples/common_xpbd/src/lib.rs b/examples/common_xpbd/src/lib.rs deleted file mode 100644 index 0df818d..0000000 --- a/examples/common_xpbd/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_worlflow_examples_common::CommonPlugin as CommonBasePlugin; - -pub use bevy_gltf_worlflow_examples_common::*; - -mod physics; - -pub struct CommonPlugin; -impl Plugin for CommonPlugin { - fn build(&self, app: &mut App) { - app.add_plugins((physics::plugin, CommonBasePlugin)); - } -} diff --git a/examples/demo/multiple_levels_multiple_blendfiles/Cargo.toml b/examples/demo/Cargo.toml similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/Cargo.toml rename to examples/demo/Cargo.toml diff --git a/examples/demo/multiple_levels_multiple_blendfiles/README.md b/examples/demo/README.md similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/README.md rename to examples/demo/README.md diff --git a/examples/demo/multiple_levels_multiple_blendfiles/art/common.blend b/examples/demo/art/common.blend similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/art/common.blend rename to examples/demo/art/common.blend diff --git a/examples/demo/multiple_levels_multiple_blendfiles/art/level1.blend b/examples/demo/art/level1.blend similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/art/level1.blend rename to examples/demo/art/level1.blend diff --git a/examples/demo/multiple_levels_multiple_blendfiles/art/level2.blend b/examples/demo/art/level2.blend similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/art/level2.blend rename to examples/demo/art/level2.blend diff --git a/examples/demo/multiple_levels_multiple_blendfiles/art/start_level.blend b/examples/demo/art/start_level.blend similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/art/start_level.blend rename to examples/demo/art/start_level.blend diff --git a/examples/demo/basic_xpbd_physics/assets/assets_core.assets.ron b/examples/demo/assets/assets_core.assets.ron similarity index 100% rename from examples/demo/basic_xpbd_physics/assets/assets_core.assets.ron rename to examples/demo/assets/assets_core.assets.ron diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/assets_game.assets.ron b/examples/demo/assets/assets_game.assets.ron similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/assets_game.assets.ron rename to examples/demo/assets/assets_game.assets.ron diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/materials/common_materials_library.glb b/examples/demo/assets/materials/common_materials_library.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/materials/common_materials_library.glb rename to examples/demo/assets/materials/common_materials_library.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/Level1.glb b/examples/demo/assets/models/Level1.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/Level1.glb rename to examples/demo/assets/models/Level1.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/Level2.glb b/examples/demo/assets/models/Level2.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/Level2.glb rename to examples/demo/assets/models/Level2.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/StartLevel.glb b/examples/demo/assets/models/StartLevel.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/StartLevel.glb rename to examples/demo/assets/models/StartLevel.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Container.glb b/examples/demo/assets/models/library/Container.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Container.glb rename to examples/demo/assets/models/library/Container.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Crystal.glb b/examples/demo/assets/models/library/Crystal.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Crystal.glb rename to examples/demo/assets/models/library/Crystal.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Health_Pickup.glb b/examples/demo/assets/models/library/Health_Pickup.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Health_Pickup.glb rename to examples/demo/assets/models/library/Health_Pickup.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Interactible.glb b/examples/demo/assets/models/library/Interactible.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Interactible.glb rename to examples/demo/assets/models/library/Interactible.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/LevelTransition.glb b/examples/demo/assets/models/library/LevelTransition.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/LevelTransition.glb rename to examples/demo/assets/models/library/LevelTransition.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/MagicTeapot.glb b/examples/demo/assets/models/library/MagicTeapot.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/MagicTeapot.glb rename to examples/demo/assets/models/library/MagicTeapot.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Nest_test.glb b/examples/demo/assets/models/library/Nest_test.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Nest_test.glb rename to examples/demo/assets/models/library/Nest_test.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Pillar.glb b/examples/demo/assets/models/library/Pillar.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Pillar.glb rename to examples/demo/assets/models/library/Pillar.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Player.glb b/examples/demo/assets/models/library/Player.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Player.glb rename to examples/demo/assets/models/library/Player.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Portal.glb b/examples/demo/assets/models/library/Portal.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Portal.glb rename to examples/demo/assets/models/library/Portal.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Rock Pile.glb b/examples/demo/assets/models/library/Rock Pile.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Rock Pile.glb rename to examples/demo/assets/models/library/Rock Pile.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Rock.glb b/examples/demo/assets/models/library/Rock.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Rock.glb rename to examples/demo/assets/models/library/Rock.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Sub_blueprint.glb b/examples/demo/assets/models/library/Sub_blueprint.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Sub_blueprint.glb rename to examples/demo/assets/models/library/Sub_blueprint.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Template_Demo.glb b/examples/demo/assets/models/library/Template_Demo.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Template_Demo.glb rename to examples/demo/assets/models/library/Template_Demo.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Unused_in_level_test.glb b/examples/demo/assets/models/library/Unused_in_level_test.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Unused_in_level_test.glb rename to examples/demo/assets/models/library/Unused_in_level_test.glb diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Wall.glb b/examples/demo/assets/models/library/Wall.glb similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/assets/models/library/Wall.glb rename to examples/demo/assets/models/library/Wall.glb diff --git a/examples/demo/basic_xpbd_physics/Cargo.toml b/examples/demo/basic_xpbd_physics/Cargo.toml deleted file mode 100644 index 16b4878..0000000 --- a/examples/demo/basic_xpbd_physics/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "bevy_gltf_blueprints_basic_xpbd_physics_example" -version = "0.3.0" -edition = "2021" -license = "MIT OR Apache-2.0" - -[dependencies] -bevy = { version = "0.13", features = ["dynamic_linking"] } -bevy_gltf_blueprints = { path = "../../../crates/bevy_gltf_blueprints" } -bevy_gltf_worlflow_examples_common_xpbd = { path = "../../common_xpbd" } -bevy_xpbd_3d = "0.4" -rand = "0.8.5" \ No newline at end of file diff --git a/examples/demo/basic_xpbd_physics/README.md b/examples/demo/basic_xpbd_physics/README.md deleted file mode 100644 index a6a1051..0000000 --- a/examples/demo/basic_xpbd_physics/README.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Basic xpbd physics example/demo - -Same as the basic example but using [xpbd](https://github.com/Jondolf/bevy_xpbd) instead of Rapier [rapier](https://github.com/dimforge/bevy_rapier) - -## Running this example - -``` -cargo run --features bevy/dynamic_linking -``` - -### Additional notes - -* You usually define either the Components directly or use ```Proxy components``` that get replaced in Bevy systems with the actual Components that you want (usually when for some reason, ie external crates with unregistered components etc) you cannot use the components directly. -* this example contains code for future features, not finished yet ! please disregard anything related to saving & loading diff --git a/examples/demo/basic_xpbd_physics/assets/advanced.blend b/examples/demo/basic_xpbd_physics/assets/advanced.blend deleted file mode 100644 index 17f54bd..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/advanced.blend and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/assets_game.assets.ron b/examples/demo/basic_xpbd_physics/assets/assets_game.assets.ron deleted file mode 100644 index 5b1e969..0000000 --- a/examples/demo/basic_xpbd_physics/assets/assets_game.assets.ron +++ /dev/null @@ -1,6 +0,0 @@ -({ - "world":File (path: "models/World.glb"), - "models": Folder ( - path: "models/library", - ), -}) \ No newline at end of file diff --git a/examples/demo/basic_xpbd_physics/assets/models/World.glb b/examples/demo/basic_xpbd_physics/assets/models/World.glb deleted file mode 100644 index 8ccee31..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/World.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/Container.glb b/examples/demo/basic_xpbd_physics/assets/models/library/Container.glb deleted file mode 100644 index 6d57403..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/Container.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/Health_Pickup.glb b/examples/demo/basic_xpbd_physics/assets/models/library/Health_Pickup.glb deleted file mode 100644 index 4643320..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/Health_Pickup.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/MagicTeapot.glb b/examples/demo/basic_xpbd_physics/assets/models/library/MagicTeapot.glb deleted file mode 100644 index 7a7020b..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/MagicTeapot.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/Pillar.glb b/examples/demo/basic_xpbd_physics/assets/models/library/Pillar.glb deleted file mode 100644 index 24c17ac..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/Pillar.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/Player.glb b/examples/demo/basic_xpbd_physics/assets/models/library/Player.glb deleted file mode 100644 index a7ef15f..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/Player.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/assets/models/library/Unused_in_level_test.glb b/examples/demo/basic_xpbd_physics/assets/models/library/Unused_in_level_test.glb deleted file mode 100644 index b5937bb..0000000 Binary files a/examples/demo/basic_xpbd_physics/assets/models/library/Unused_in_level_test.glb and /dev/null differ diff --git a/examples/demo/basic_xpbd_physics/src/core/mod.rs b/examples/demo/basic_xpbd_physics/src/core/mod.rs deleted file mode 100644 index 1ed6e81..0000000 --- a/examples/demo/basic_xpbd_physics/src/core/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_blueprints::*; - -pub struct CorePlugin; -impl Plugin for CorePlugin { - fn build(&self, app: &mut App) { - app.add_plugins((BlueprintsPlugin { - ..Default::default() - },)); - } -} diff --git a/examples/demo/basic_xpbd_physics/src/game/in_game.rs b/examples/demo/basic_xpbd_physics/src/game/in_game.rs deleted file mode 100644 index 6853655..0000000 --- a/examples/demo/basic_xpbd_physics/src/game/in_game.rs +++ /dev/null @@ -1,76 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_blueprints::{BluePrintBundle, BlueprintName, GameWorldTag}; -use bevy_gltf_worlflow_examples_common_xpbd::{assets::GameAssets, GameState, InAppRunning}; -use bevy_xpbd_3d::prelude::*; -use rand::Rng; - -pub fn setup_game( - mut commands: Commands, - game_assets: Res, - models: Res>, - mut next_game_state: ResMut>, -) { - commands.insert_resource(AmbientLight { - color: Color::WHITE, - brightness: 0.2, - }); - // here we actually spawn our game world/level - - commands.spawn(( - SceneBundle { - // note: because of this issue https://github.com/bevyengine/bevy/issues/10436, "world" is now a gltf file instead of a scene - scene: models - .get(game_assets.world.clone().unwrap().id()) - .expect("main level should have been loaded") - .scenes[0] - .clone(), - ..default() - }, - bevy::prelude::Name::from("world"), - GameWorldTag, - InAppRunning, - )); - - next_game_state.set(GameState::InGame) -} - -pub fn spawn_test( - keycode: Res>, - mut commands: Commands, - - mut game_world: Query<(Entity, &Children), With>, -) { - if keycode.just_pressed(KeyCode::KeyT) { - let world = game_world.single_mut(); - let world = world.1[0]; - - let mut rng = rand::thread_rng(); - let range = 5.5; - let x: f32 = rng.gen_range(-range..range); - let y: f32 = rng.gen_range(-range..range); - - let mut rng = rand::thread_rng(); - let range = 0.8; - let vel_x: f32 = rng.gen_range(-range..range); - let vel_y: f32 = rng.gen_range(2.0..2.5); - let vel_z: f32 = rng.gen_range(-range..range); - - let name_index: u64 = rng.gen(); - - let new_entity = commands - .spawn(( - BluePrintBundle { - blueprint: BlueprintName("Health_Pickup".to_string()), - ..Default::default() - }, - bevy::prelude::Name::from(format!("test{}", name_index)), - // BlueprintName("Health_Pickup".to_string()), - // SpawnHere, - TransformBundle::from_transform(Transform::from_xyz(x, 2.0, y)), - LinearVelocity(Vec3::new(vel_x, vel_y, vel_z)), - AngularVelocity::ZERO, - )) - .id(); - commands.entity(world).add_child(new_entity); - } -} diff --git a/examples/demo/basic_xpbd_physics/src/game/in_main_menu.rs b/examples/demo/basic_xpbd_physics/src/game/in_main_menu.rs deleted file mode 100644 index 212d1fc..0000000 --- a/examples/demo/basic_xpbd_physics/src/game/in_main_menu.rs +++ /dev/null @@ -1,107 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_worlflow_examples_common_xpbd::{AppState, InMainMenu}; - -pub fn setup_main_menu(mut commands: Commands) { - commands.spawn(( - Camera2dBundle { - camera: Camera { - order: 102, // needed because of this: https://github.com/jakobhellermann/bevy_editor_pls/blob/crates/bevy_editor_pls_default_windows/src/cameras/mod.rs#L213C9-L213C28 - ..default() - }, - ..Default::default() - }, - InMainMenu, - )); - - commands.spawn(( - TextBundle::from_section( - "SOME GAME TITLE !!", - TextStyle { - //font: asset_server.load("fonts/FiraMono-Medium.ttf"), - font_size: 18.0, - color: Color::WHITE, - ..Default::default() - }, - ) - .with_style(Style { - position_type: PositionType::Absolute, - top: Val::Px(100.0), - left: Val::Px(200.0), - ..default() - }), - InMainMenu, - )); - - commands.spawn(( - TextBundle::from_section( - "New Game (press Enter to start, press T once the game is started for demo spawning)", - TextStyle { - //font: asset_server.load("fonts/FiraMono-Medium.ttf"), - font_size: 18.0, - color: Color::WHITE, - ..Default::default() - }, - ) - .with_style(Style { - position_type: PositionType::Absolute, - top: Val::Px(200.0), - left: Val::Px(200.0), - ..default() - }), - InMainMenu, - )); - - /* - commands.spawn(( - TextBundle::from_section( - "Load Game", - TextStyle { - //font: asset_server.load("fonts/FiraMono-Medium.ttf"), - font_size: 18.0, - color: Color::WHITE, - ..Default::default() - }, - ) - .with_style(Style { - position_type: PositionType::Absolute, - top: Val::Px(250.0), - left: Val::Px(200.0), - ..default() - }), - InMainMenu - )); - - commands.spawn(( - TextBundle::from_section( - "Exit Game", - TextStyle { - //font: asset_server.load("fonts/FiraMono-Medium.ttf"), - font_size: 18.0, - color: Color::WHITE, - ..Default::default() - }, - ) - .with_style(Style { - position_type: PositionType::Absolute, - top: Val::Px(300.0), - left: Val::Px(200.0), - ..default() - }), - InMainMenu - ));*/ -} - -pub fn teardown_main_menu(bla: Query>, mut commands: Commands) { - for bli in bla.iter() { - commands.entity(bli).despawn_recursive(); - } -} - -pub fn main_menu( - keycode: Res>, - mut next_app_state: ResMut>, -) { - if keycode.just_pressed(KeyCode::Enter) { - next_app_state.set(AppState::AppLoading); - } -} diff --git a/examples/demo/basic_xpbd_physics/src/game/mod.rs b/examples/demo/basic_xpbd_physics/src/game/mod.rs deleted file mode 100644 index 8aff7d6..0000000 --- a/examples/demo/basic_xpbd_physics/src/game/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub mod in_game; -pub use in_game::*; - -pub mod in_main_menu; -pub use in_main_menu::*; - -use bevy::prelude::*; -use bevy_gltf_worlflow_examples_common_xpbd::{AppState, GameState}; - -pub struct GamePlugin; -impl Plugin for GamePlugin { - fn build(&self, app: &mut App) { - app.add_systems(Update, (spawn_test,).run_if(in_state(GameState::InGame))) - .add_systems(OnEnter(AppState::MenuRunning), setup_main_menu) - .add_systems(OnExit(AppState::MenuRunning), teardown_main_menu) - .add_systems(Update, main_menu.run_if(in_state(AppState::MenuRunning))) - .add_systems(OnEnter(AppState::AppRunning), setup_game); - } -} diff --git a/examples/demo/basic_xpbd_physics/src/main.rs b/examples/demo/basic_xpbd_physics/src/main.rs deleted file mode 100644 index 2de0274..0000000 --- a/examples/demo/basic_xpbd_physics/src/main.rs +++ /dev/null @@ -1,24 +0,0 @@ -use bevy::prelude::*; -use bevy_gltf_worlflow_examples_common_xpbd::CommonPlugin; - -mod core; -use crate::core::*; - -mod game; -use game::*; - -mod test_components; -use test_components::*; - -fn main() { - App::new() - .add_plugins(( - DefaultPlugins.set(AssetPlugin::default()), - // our custom plugins - CommonPlugin, - CorePlugin, // reusable plugins - GamePlugin, // specific to our game - ComponentsTestPlugin, // Showcases different type of components /structs - )) - .run(); -} diff --git a/examples/demo/multiple_levels_multiple_blendfiles/assets/assets_core.assets.ron b/examples/demo/multiple_levels_multiple_blendfiles/assets/assets_core.assets.ron deleted file mode 100644 index 8d0a099..0000000 --- a/examples/demo/multiple_levels_multiple_blendfiles/assets/assets_core.assets.ron +++ /dev/null @@ -1 +0,0 @@ -({}) \ No newline at end of file diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/test_components.rs b/examples/demo/multiple_levels_multiple_blendfiles/src/test_components.rs deleted file mode 100644 index b5384e2..0000000 --- a/examples/demo/multiple_levels_multiple_blendfiles/src/test_components.rs +++ /dev/null @@ -1,80 +0,0 @@ -use bevy::prelude::*; - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct UnitTest; - -#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)] -#[reflect(Component)] -struct TupleTestF32(f32); - -#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)] -#[reflect(Component)] -struct TupleTestU64(u64); - -#[derive(Component, Reflect, Default, Debug, Deref, DerefMut)] -#[reflect(Component)] -pub struct TupleTestStr(String); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleTest2(f32, u64, String); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleTestBool(bool); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleVec2(Vec2); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleVec3(Vec3); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleVec(Vec); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct TupleTestColor(Color); - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -struct BasicTest { - a: f32, - b: u64, - c: String, -} - -#[derive(Component, Reflect, Default, Debug)] -#[reflect(Component)] -pub enum EnumTest { - Metal, - Wood, - Rock, - Cloth, - Squishy, - #[default] - None, -} - -pub struct ComponentsTestPlugin; -impl Plugin for ComponentsTestPlugin { - fn build(&self, app: &mut App) { - app.register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::() - .register_type::>(); - } -} diff --git a/examples/common/src/core/audio/mod.rs b/examples/demo/src/core/audio/mod.rs similarity index 100% rename from examples/common/src/core/audio/mod.rs rename to examples/demo/src/core/audio/mod.rs diff --git a/examples/common/src/core/camera/camera_replace_proxies.rs b/examples/demo/src/core/camera/camera_replace_proxies.rs similarity index 100% rename from examples/common/src/core/camera/camera_replace_proxies.rs rename to examples/demo/src/core/camera/camera_replace_proxies.rs diff --git a/examples/common/src/core/camera/camera_tracking.rs b/examples/demo/src/core/camera/camera_tracking.rs similarity index 100% rename from examples/common/src/core/camera/camera_tracking.rs rename to examples/demo/src/core/camera/camera_tracking.rs diff --git a/examples/common/src/core/camera/mod.rs b/examples/demo/src/core/camera/mod.rs similarity index 100% rename from examples/common/src/core/camera/mod.rs rename to examples/demo/src/core/camera/mod.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/core/mod.rs b/examples/demo/src/core/mod.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/core/mod.rs rename to examples/demo/src/core/mod.rs diff --git a/examples/common_rapier/src/physics/controls.rs b/examples/demo/src/core/physics_rapier/controls.rs similarity index 100% rename from examples/common_rapier/src/physics/controls.rs rename to examples/demo/src/core/physics_rapier/controls.rs diff --git a/examples/common_rapier/src/physics/mod.rs b/examples/demo/src/core/physics_rapier/mod.rs similarity index 100% rename from examples/common_rapier/src/physics/mod.rs rename to examples/demo/src/core/physics_rapier/mod.rs diff --git a/examples/common_rapier/src/physics/physics_replace_proxies.rs b/examples/demo/src/core/physics_rapier/physics_replace_proxies.rs similarity index 100% rename from examples/common_rapier/src/physics/physics_replace_proxies.rs rename to examples/demo/src/core/physics_rapier/physics_replace_proxies.rs diff --git a/examples/common_rapier/src/physics/utils.rs b/examples/demo/src/core/physics_rapier/utils.rs similarity index 100% rename from examples/common_rapier/src/physics/utils.rs rename to examples/demo/src/core/physics_rapier/utils.rs diff --git a/examples/common_xpbd/src/physics/controls.rs b/examples/demo/src/core/physics_xpbd/controls.rs similarity index 100% rename from examples/common_xpbd/src/physics/controls.rs rename to examples/demo/src/core/physics_xpbd/controls.rs diff --git a/examples/common_xpbd/src/physics/mod.rs b/examples/demo/src/core/physics_xpbd/mod.rs similarity index 100% rename from examples/common_xpbd/src/physics/mod.rs rename to examples/demo/src/core/physics_xpbd/mod.rs diff --git a/examples/common_xpbd/src/physics/physics_replace_proxies.rs b/examples/demo/src/core/physics_xpbd/physics_replace_proxies.rs similarity index 100% rename from examples/common_xpbd/src/physics/physics_replace_proxies.rs rename to examples/demo/src/core/physics_xpbd/physics_replace_proxies.rs diff --git a/examples/common_xpbd/src/physics/utils.rs b/examples/demo/src/core/physics_xpbd/utils.rs similarity index 100% rename from examples/common_xpbd/src/physics/utils.rs rename to examples/demo/src/core/physics_xpbd/utils.rs diff --git a/examples/common/src/core/relationships/mod.rs b/examples/demo/src/core/relationships/mod.rs similarity index 100% rename from examples/common/src/core/relationships/mod.rs rename to examples/demo/src/core/relationships/mod.rs diff --git a/examples/common/src/core/relationships/relationships_insert_dependant_components.rs b/examples/demo/src/core/relationships/relationships_insert_dependant_components.rs similarity index 100% rename from examples/common/src/core/relationships/relationships_insert_dependant_components.rs rename to examples/demo/src/core/relationships/relationships_insert_dependant_components.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/game/in_game.rs b/examples/demo/src/game/in_game.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/game/in_game.rs rename to examples/demo/src/game/in_game.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs b/examples/demo/src/game/in_main_menu.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/game/in_main_menu.rs rename to examples/demo/src/game/in_main_menu.rs diff --git a/examples/common/src/game/interactions/mod.rs b/examples/demo/src/game/interactions/mod.rs similarity index 100% rename from examples/common/src/game/interactions/mod.rs rename to examples/demo/src/game/interactions/mod.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/game/level_transitions.rs b/examples/demo/src/game/level_transitions.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/game/level_transitions.rs rename to examples/demo/src/game/level_transitions.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/game/mod.rs b/examples/demo/src/game/mod.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/game/mod.rs rename to examples/demo/src/game/mod.rs diff --git a/examples/common/src/game/picking/mod.rs b/examples/demo/src/game/picking/mod.rs similarity index 100% rename from examples/common/src/game/picking/mod.rs rename to examples/demo/src/game/picking/mod.rs diff --git a/examples/common/src/game/player/mod.rs b/examples/demo/src/game/player/mod.rs similarity index 100% rename from examples/common/src/game/player/mod.rs rename to examples/demo/src/game/player/mod.rs diff --git a/examples/demo/multiple_levels_multiple_blendfiles/src/main.rs b/examples/demo/src/main.rs similarity index 100% rename from examples/demo/multiple_levels_multiple_blendfiles/src/main.rs rename to examples/demo/src/main.rs diff --git a/examples/common/src/state.rs b/examples/demo/src/state.rs similarity index 100% rename from examples/common/src/state.rs rename to examples/demo/src/state.rs diff --git a/examples/demo/basic_xpbd_physics/src/test_components.rs b/examples/demo/src/test_components.rs similarity index 100% rename from examples/demo/basic_xpbd_physics/src/test_components.rs rename to examples/demo/src/test_components.rs