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