use bevy::prelude::*; use covey_asset_loader::prelude::*; use crate::{despawn_screen, AppState}; #[derive(AssetCollection, Debug, Resource, Reflect)] pub(crate) struct MainMenuAssets { #[asset(path = "fonts/FiraSans-Bold.ttf")] font1: Handle, #[asset(path = "audio/Windless Slopes.ogg")] audio1: Handle, #[asset(path = "images/banner.png")] image1: Handle, } #[derive(Component)] struct OnMainMenuScreen; pub(crate) struct MainMenuPlugin; impl Plugin for MainMenuPlugin { fn build(&self, app: &mut App) { app.state_asset_loader::() .cleanup_assets_on_exit::(AppState::MainMenu) .add_systems(( playn_button.in_set(OnUpdate(AppState::MainMenu)), setup.in_schedule(OnEnter(AppState::MainMenu)), despawn_screen::.in_schedule(OnExit(AppState::MainMenu)), )); } } #[derive(Component)] struct PlayButton; fn setup(mut commands: Commands, assets: Res, audio: Res