We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1dfcde6 commit bfbcb36Copy full SHA for bfbcb36
crates/bevy_camera/src/visibility/mod.rs
@@ -679,8 +679,14 @@ pub fn add_visibility_class<C>(
679
) where
680
C: 'static,
681
{
682
- if let Some(mut visibility_class) = world.get_mut::<VisibilityClass>(entity) {
683
- visibility_class.push(TypeId::of::<C>());
+ let Some(mut visibility_class) = world.get_mut::<VisibilityClass>(entity) else {
+ // potentially warn in this case?
684
+ return;
685
+ };
686
+
687
+ let type_id = TypeId::of::<C>();
688
+ if !visibility_class.contains(&type_id) {
689
+ visibility_class.push(type_id);
690
}
691
692
0 commit comments