Skip to content

Commit

Permalink
Add missing Default impl to ExtendedMaterial.
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Apr 17, 2024
1 parent 11afe16 commit c573139
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/bevy_pbr/src/extended_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ pub struct ExtendedMaterial<B: Material, E: MaterialExtension> {
pub extension: E,
}


impl<B, E> Default for ExtendedMaterial<B, E>
where
B: Material + Default,
E: MaterialExtension + Default,
{
fn default() -> Self {
Self {
base: B::default(),
extension: E::default(),
}
}
}

// We don't use the `TypePath` derive here due to a bug where `#[reflect(type_path = false)]`
// causes the `TypePath` derive to not generate an implementation.
impl_type_path!((in bevy_pbr::extended_material) ExtendedMaterial<B: Material, E: MaterialExtension>);
Expand Down

0 comments on commit c573139

Please sign in to comment.