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 3118ebd commit aaf204cCopy full SHA for aaf204c
crates/bevy_render/src/camera/active_cameras.rs
@@ -38,6 +38,10 @@ impl ActiveCameras {
38
self.cameras.get_mut(name)
39
}
40
41
+ pub fn remove(&mut self, name: &str) -> Option<ActiveCamera> {
42
+ self.cameras.remove(name)
43
+ }
44
+
45
pub fn iter(&self) -> impl Iterator<Item = &ActiveCamera> {
46
self.cameras.values()
47
@@ -52,6 +56,13 @@ pub fn active_cameras_system(
52
56
query: Query<(Entity, &Camera)>,
53
57
) {
54
58
for (name, active_camera) in active_cameras.cameras.iter_mut() {
59
+ if active_camera
60
+ .entity
61
+ .map_or(false, |entity| query.get(entity).is_err())
62
+ {
63
+ active_camera.entity = None;
64
65
55
66
if active_camera.entity.is_none() {
67
for (camera_entity, camera) in query.iter() {
68
if let Some(ref current_name) = camera.name {
0 commit comments