use only required plugins

This commit is contained in:
yuni 2024-03-16 23:04:58 +01:00
parent c98a6d7dc5
commit 5384ea2ec9

View file

@ -4,25 +4,49 @@ mod camera;
mod world; mod world;
mod settings; mod settings;
use bevy::window::{Window, WindowMode, PrimaryWindow, CursorGrabMode }; use bevy::a11y::AccessibilityPlugin;
use bevy::audio::AudioPlugin;
use bevy::input::InputPlugin;
use bevy::log::LogPlugin;
use bevy::prelude::*; use bevy::prelude::*;
use bevy::render::RenderPlugin;
use bevy::window::{Window, WindowMode, PrimaryWindow, CursorGrabMode};
use bevy::scene::ScenePlugin;
use bevy::core_pipeline::CorePipelinePlugin;
use bevy::pbr::PbrPlugin;
use bevy::winit::WinitPlugin;
fn main() { fn main() {
App::new() App::new()
.add_systems(Startup, ( .add_systems(Startup, (
setup, setup,
settings::setup, settings::setup,
audio::setup, audio::setup,
player::setup, player::setup,
world::setup, world::setup,
)) ))
.add_systems(Update, ( .add_systems(Update, (
handle_input, handle_input,
player::handle_input, player::handle_input,
audio::toggle_bgm, audio::toggle_bgm,
world::asset_loaded.after(world::load_cubemap_asset), world::asset_loaded.after(world::load_cubemap_asset),
))
.add_plugins((
LogPlugin::default(),
MinimalPlugins,
TransformPlugin,
InputPlugin,
WindowPlugin::default(),
AccessibilityPlugin,
AssetPlugin::default(),
ScenePlugin::default(),
WinitPlugin::default(),
RenderPlugin::default(),
ImagePlugin::default_nearest(),
CorePipelinePlugin::default(),
PbrPlugin::default(),
AudioPlugin::default(),
)) ))
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugins(camera::CameraControllerPlugin) .add_plugins(camera::CameraControllerPlugin)
.run(); .run();
} }