diff --git a/crates/bevy_ui/src/focus.rs b/crates/bevy_ui/src/focus.rs index b0096dcbd500e..e2abb8d6889d5 100644 --- a/crates/bevy_ui/src/focus.rs +++ b/crates/bevy_ui/src/focus.rs @@ -1,5 +1,4 @@ -use crate::{camera_config::UiCameraConfig, CalculatedClip, Node, UiCamera, UiScale, UiStack}; -use bevy_derive::{Deref, DerefMut}; +use crate::{camera_config::UiCameraConfig, CalculatedClip, Node, TargetCamera, UiScale, UiStack}; use bevy_ecs::{ change_detection::DetectChangesMut, entity::Entity, @@ -126,7 +125,7 @@ pub struct NodeQuery { focus_policy: Option<&'static FocusPolicy>, calculated_clip: Option<&'static CalculatedClip>, view_visibility: Option<&'static ViewVisibility>, - ui_camera: Option<&'static UiCamera>, + target_camera: Option<&'static TargetCamera>, } /// The system that sets Interaction for all UI elements based on the mouse cursor activity @@ -226,8 +225,8 @@ pub fn ui_focus_system( return None; } let Some(camera_entity) = node - .ui_camera - .map(UiCamera::entity) + .target_camera + .map(TargetCamera::entity) .or(default_single_camera) else { return None; diff --git a/crates/bevy_ui/src/layout/mod.rs b/crates/bevy_ui/src/layout/mod.rs index 95dc6503319a9..6e7788ed7991d 100644 --- a/crates/bevy_ui/src/layout/mod.rs +++ b/crates/bevy_ui/src/layout/mod.rs @@ -1,7 +1,7 @@ mod convert; pub mod debug; -use crate::{ContentSize, Node, Outline, Style, UiCamera, UiScale}; +use crate::{ContentSize, Node, Outline, Style, TargetCamera, UiScale}; use bevy_ecs::{ change_detection::{DetectChanges, DetectChangesMut}, entity::Entity, @@ -249,8 +249,8 @@ pub fn ui_layout_system( mut scale_factor_events: EventReader, mut resize_events: EventReader, mut ui_surface: ResMut, - root_node_query: Query<(Entity, Option<&UiCamera>), (With, Without)>, - style_query: Query<(Entity, Ref