diff --git a/src/game/dice.rs b/src/game/dice.rs index af6f2c6..1fe86e8 100644 --- a/src/game/dice.rs +++ b/src/game/dice.rs @@ -50,6 +50,7 @@ fn init_dice_cuboid(mut commands: Commands, mut meshes: ResMut>) { [1.0, e], [0.0, e], [0.0, f], [1.0, f], ], ); + info!("Adding cuboid {:?}", cuboid); commands.insert_resource(DiceCuboid { mesh: meshes.add(cuboid) }); } @@ -97,9 +98,7 @@ fn init_dice_ui(mut commands: Commands) { }); } -fn init_dice( - mut commands: Commands, -) { +fn init_dice(mut commands: Commands) { [ ["a", "b", "c", "d", "e", "f"], ["g", "h", "i", "j", "k", "l"], @@ -107,7 +106,7 @@ fn init_dice( ] .into_iter() .enumerate() - .for_each(|(idx, set)| { + .for_each(|(_idx, set)| { commands .spawn(( GameChoice::Dice, @@ -182,7 +181,6 @@ struct DiceCuboid { impl EntityCommand for Die { fn apply(self, id: Entity, world: &mut World) { - info!("Applying entity command for die"); // Image we will render our texture to @@ -227,7 +225,8 @@ impl EntityCommand for Die { .id(); // Scene being rendered to a texture - world.spawn(( + world + .spawn(( NodeBundle { style: Style { width: Val::Percent(100.0), @@ -274,18 +273,21 @@ impl EntityCommand for Die { }); // Material used for this object - let this_material = world.resource_mut::>().add(StandardMaterial { - base_color_texture: Some(image_handle), - ..default() - }); + let this_material = + world + .resource_mut::>() + .add(StandardMaterial { + base_color_texture: Some(image_handle), + ..default() + }); let pbr_bundle = PbrBundle { mesh: world.resource::().mesh.clone(), - material: this_material, + material: this_material.clone(), ..default() }; - world.entity_mut(id).insert((self, pbr_bundle)); + world.entity_mut(id).insert((self, pbr_bundle.clone())); } } diff --git a/src/game/mod.rs b/src/game/mod.rs index e860e0f..c997606 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -33,7 +33,7 @@ pub(crate) enum GameChoice { fn init_camera(mut commands: Commands) { commands.spawn(Camera3dBundle { camera: Camera { - clear_color: ClearColorConfig::Custom(Color::WHITE), + clear_color: ClearColorConfig::Custom(Color::ALICE_BLUE), ..default() }, transform: Transform::from_xyz(10.0, 10.0, 10.0), diff --git a/src/prelude.rs b/src/prelude.rs index db3024e..1f0d07f 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -9,7 +9,6 @@ pub(crate) use bevy::render::camera::RenderTarget; pub(crate) use bevy::render::render_resource::{ Extent3d, TextureDescriptor, TextureDimension, TextureFormat, TextureUsages, }; -pub(crate) use bevy::sprite::MaterialMesh2dBundle; /// Bevy Plugins pub(crate) use bevy_mod_picking::prelude::*;