diff --git a/Cargo.toml b/Cargo.toml index 8566896..c4bbdac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_meshem" -version = "0.5.0" +version = "0.5.1" edition = "2021" authors = ["Adamkob12"] description = "A crate that offers a flexible and efficient way to generate meshes from a grid of Voxels" @@ -11,5 +11,5 @@ documentation = "https://docs.rs/bevy_meshem" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = "0.16.0" +bevy = "0.18.0" rand = "0.8.5" diff --git a/examples/simple_example.rs b/examples/simple_example.rs index 061de7e..584fa03 100644 --- a/examples/simple_example.rs +++ b/examples/simple_example.rs @@ -23,14 +23,10 @@ fn main() { Some(0.8), 1.0, ), - }) - .insert_resource(AmbientLight { - brightness: 1500.0, - color: Color::WHITE, - ..default() }); - app.add_systems(Startup, setup).add_systems( + app.add_systems(Startup, setup) + .add_systems( Update, ( input_handler, @@ -40,8 +36,8 @@ fn main() { ), ); - app.add_event::() - .add_event::(); + app.add_message::() + .add_message::(); app.run(); } @@ -55,10 +51,10 @@ struct Meshy { #[derive(Component)] struct MeshInfo; -#[derive(Event, Default)] +#[derive(Message, Default)] struct ToggleWireframe; -#[derive(Event, Default)] +#[derive(Message, Default)] struct RegenerateMesh; /// Setting up everything to showcase the mesh. @@ -114,7 +110,12 @@ fn setup( // Camera in 3D space. commands.spawn(( Camera3d::default(), - camera_and_light_transform + camera_and_light_transform, + AmbientLight { + brightness: 1500.0, + color: Color::WHITE, + ..default() + } )); // Light up the scene. @@ -190,7 +191,7 @@ impl VoxelRegistry for BlockRegistry { /// The attributes we want to take from out voxels, note that using a lot of different /// attributes will likely lead to performance problems and unpredictable behaviour. /// We chose these 3 because they are very common, the algorithm does preserve UV data. - fn all_attributes(&self) -> Vec { + fn all_attributes(&self) -> Vec { return vec![ Mesh::ATTRIBUTE_POSITION, Mesh::ATTRIBUTE_UV_0, @@ -204,8 +205,8 @@ fn input_handler( keyboard_input: Res>, mut query: Query<&mut Transform, With>, time: Res