2023-10-14 11:51:29 +00:00
|
|
|
use bevy::{asset::ChangeWatcher, prelude::*};
|
2023-09-28 12:10:45 +00:00
|
|
|
use bevy_editor_pls::prelude::*;
|
|
|
|
|
|
|
|
mod core;
|
|
|
|
use crate::core::*;
|
|
|
|
|
|
|
|
pub mod assets;
|
|
|
|
use assets::*;
|
|
|
|
|
|
|
|
pub mod state;
|
|
|
|
use state::*;
|
|
|
|
|
|
|
|
mod game;
|
|
|
|
use game::*;
|
|
|
|
|
|
|
|
mod test_components;
|
|
|
|
use test_components::*;
|
|
|
|
|
2023-10-13 10:53:26 +00:00
|
|
|
fn main() {
|
2023-09-28 12:10:45 +00:00
|
|
|
App::new()
|
2023-10-13 10:53:26 +00:00
|
|
|
.add_plugins((
|
|
|
|
DefaultPlugins.set(AssetPlugin {
|
2023-09-28 12:10:45 +00:00
|
|
|
// This tells the AssetServer to watch for changes to assets.
|
|
|
|
// It enables our scenes to automatically reload in game when we modify their files.
|
|
|
|
// practical in our case to be able to edit the shaders without needing to recompile
|
|
|
|
// watch_for_changes: ChangeWatcher::with_delay(Duration::from_millis(50)), : FIXME: breaks scene save/loading
|
|
|
|
..default()
|
2023-10-13 10:53:26 +00:00
|
|
|
}),
|
|
|
|
// editor
|
|
|
|
EditorPlugin::default(),
|
|
|
|
// our custom plugins
|
|
|
|
StatePlugin,
|
|
|
|
AssetsPlugin,
|
|
|
|
CorePlugin, // reusable plugins
|
|
|
|
GamePlugin, // specific to our game
|
|
|
|
ComponentsTestPlugin, // Showcases different type of components /structs
|
|
|
|
))
|
|
|
|
.run();
|
2023-09-28 12:10:45 +00:00
|
|
|
}
|