Swapping back to using From<Color> for StandardMaterial in examples (#13566)

# Objective

Fixes #13547
This commit is contained in:
andristarr 2024-05-29 15:50:28 +02:00 committed by GitHub
parent 29d6575e22
commit 2ac290dd8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 16 deletions

View file

@ -18,20 +18,14 @@ fn setup(
// circular base
commands.spawn(PbrBundle {
mesh: meshes.add(Circle::new(4.0)),
material: materials.add(StandardMaterial {
base_color: Color::WHITE,
..Default::default()
}),
material: materials.add(Color::WHITE),
transform: Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
..default()
});
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Cuboid::new(1.0, 1.0, 1.0)),
material: materials.add(StandardMaterial {
base_color: Srgba::rgb_u8(124, 144, 255).into(),
..Default::default()
}),
material: materials.add(Color::srgb_u8(124, 144, 255)),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});

View file

@ -52,10 +52,7 @@ fn setup(
commands.spawn((
PbrBundle {
mesh: meshes.add(Plane3d::default().mesh().size(20., 20.)),
material: materials.add(StandardMaterial {
base_color: LinearRgba::rgb(0.3, 0.5, 0.3).into(),
..default()
}),
material: materials.add(Color::srgb(0.3, 0.5, 0.3)),
..default()
},
Ground,

View file

@ -261,10 +261,7 @@ fn setup(
// Plane
commands.spawn(PbrBundle {
mesh: meshes.add(Plane3d::default().mesh().size(50.0, 50.0)),
material: materials.add(StandardMaterial {
base_color: LinearRgba::rgb(0.1, 0.2, 0.1).into(),
..Default::default()
}),
material: materials.add(Color::srgb(0.1, 0.2, 0.1)),
..default()
});