Derive Reflect on Skybox (#17781)

# Objective

- Derive Reflect on Skybox component

## Solution

- Derive Reflect on Skybox component
This commit is contained in:
jf908 2025-02-10 22:24:23 +00:00 committed by GitHub
parent 3978ba9783
commit f27e00b197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,12 +3,14 @@ use bevy_asset::{load_internal_asset, weak_handle, Handle};
use bevy_ecs::{
prelude::{Component, Entity},
query::{QueryItem, With},
reflect::ReflectComponent,
resource::Resource,
schedule::IntoSystemConfigs,
system::{Commands, Query, Res, ResMut},
};
use bevy_image::{BevyDefault, Image};
use bevy_math::{Mat4, Quat};
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::{
camera::Exposure,
extract_component::{
@ -46,7 +48,7 @@ impl Plugin for SkyboxPlugin {
Shader::from_wgsl
);
app.add_plugins((
app.register_type::<Skybox>().add_plugins((
ExtractComponentPlugin::<Skybox>::default(),
UniformComponentPlugin::<SkyboxUniforms>::default(),
));
@ -87,7 +89,8 @@ impl Plugin for SkyboxPlugin {
/// To do so, use `EnvironmentMapLight` alongside this component.
///
/// See also <https://en.wikipedia.org/wiki/Skybox_(video_games)>.
#[derive(Component, Clone)]
#[derive(Component, Clone, Reflect)]
#[reflect(Component, Default)]
pub struct Skybox {
pub image: Handle<Image>,
/// Scale factor applied to the skybox image.