make materials unlit

This commit is contained in:
awtterpip
2024-06-02 22:31:38 -05:00
parent 32fa13b4fd
commit be23326859

View File

@@ -37,17 +37,21 @@ fn setup(
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
) { ) {
let mut white: StandardMaterial = Color::WHITE.into();
white.unlit = true;
// circular base // circular base
commands.spawn(PbrBundle { commands.spawn(PbrBundle {
mesh: meshes.add(Circle::new(4.0)), mesh: meshes.add(Circle::new(4.0)),
material: materials.add(Color::WHITE), material: materials.add(white),
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)), transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
..default() ..default()
}); });
let mut cube_mat: StandardMaterial = Color::rgb_u8(124, 144, 255).into();
cube_mat.unlit = true;
// cube // cube
commands.spawn(PbrBundle { commands.spawn(PbrBundle {
mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)), mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)),
material: materials.add(Color::rgb_u8(124, 144, 255)), material: materials.add(cube_mat),
transform: Transform::from_xyz(0.0, 0.5, 0.0), transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default() ..default()
}); });