mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 11:50: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
36 lines
1.3 KiB
Rust
36 lines
1.3 KiB
Rust
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),
|
|
)
|
|
.add_dynamic_collection_to_loading_state::<_, StandardDynamicAssetCollection>(
|
|
AppState::CoreLoading,
|
|
"animation/assets_core.assets.ron",
|
|
)
|
|
.add_collection_to_loading_state::<_, CoreAssets>(AppState::CoreLoading)
|
|
// load game assets
|
|
.add_loading_state(
|
|
LoadingState::new(AppState::AppLoading).continue_to_state(AppState::AppRunning),
|
|
)
|
|
.add_dynamic_collection_to_loading_state::<_, StandardDynamicAssetCollection>(
|
|
AppState::AppLoading,
|
|
"animation/assets_game.assets.ron",
|
|
)
|
|
.add_collection_to_loading_state::<_, GameAssets>(AppState::AppLoading);
|
|
}
|
|
}
|