Skip to content

Commit

Permalink
Implement and register Reflect (value) for CameraRenderGraph and Came…
Browse files Browse the repository at this point in the history
…raMainTextureUsages
  • Loading branch information
cart committed Feb 15, 2024
1 parent 73bf730 commit 84e2cd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_render/src/camera/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ impl Default for CameraOutputMode {
}

/// Configures the [`RenderGraph`](crate::render_graph::RenderGraph) name assigned to be run for a given [`Camera`] entity.
#[derive(Component, Deref, DerefMut)]
#[derive(Component, Deref, DerefMut, Reflect, Clone)]
#[reflect_value(Component)]
pub struct CameraRenderGraph(InternedRenderSubGraph);

impl CameraRenderGraph {
Expand Down Expand Up @@ -752,7 +753,8 @@ pub fn camera_system<T: CameraProjection + Component>(
}

/// This component lets you control the [`TextureUsages`] field of the main texture generated for the camera
#[derive(Component, ExtractComponent, Clone, Copy)]
#[derive(Component, ExtractComponent, Clone, Copy, Reflect)]
#[reflect_value(Component)]
pub struct CameraMainTextureUsages(pub TextureUsages);
impl Default for CameraMainTextureUsages {
fn default() -> Self {
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_render/src/camera/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ impl Plugin for CameraPlugin {
.register_type::<RenderTarget>()
.register_type::<ClearColor>()
.register_type::<ClearColorConfig>()
.register_type::<CameraRenderGraph>()
.register_type::<CameraMainTextureUsages>()
.init_resource::<ManualTextureViews>()
.init_resource::<ClearColor>()
.add_plugins((
Expand Down

0 comments on commit 84e2cd6

Please sign in to comment.