Register some types (#19361)

# Objective

Fill in some `Reflect` and `app.register_type` gaps.

I only really wanted `GlobalZIndex` but figured I'd fill in a few others
as well.
This commit is contained in:
Ben Frankel 2025-05-25 19:30:07 -07:00 committed by GitHub
parent 3d3746e5d0
commit 3d9fc5ca10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View File

@ -92,7 +92,8 @@ use render_asset::{
use renderer::{RenderAdapter, RenderDevice, RenderQueue};
use settings::RenderResources;
use sync_world::{
despawn_temporary_render_entities, entity_sync_system, SyncToRenderWorld, SyncWorldPlugin,
despawn_temporary_render_entities, entity_sync_system, MainEntity, RenderEntity,
SyncToRenderWorld, SyncWorldPlugin, TemporaryRenderEntity,
};
use crate::gpu_readback::GpuReadbackPlugin;
@ -449,6 +450,9 @@ impl Plugin for RenderPlugin {
.register_type::<primitives::CascadesFrusta>()
.register_type::<primitives::CubemapFrusta>()
.register_type::<primitives::Frustum>()
.register_type::<RenderEntity>()
.register_type::<TemporaryRenderEntity>()
.register_type::<MainEntity>()
.register_type::<SyncToRenderWorld>();
}

View File

@ -126,8 +126,9 @@ pub struct SyncToRenderWorld;
/// Component added on the main world entities that are synced to the Render World in order to keep track of the corresponding render world entity.
///
/// Can also be used as a newtype wrapper for render world entities.
#[derive(Deref, Copy, Clone, Debug, Eq, Hash, PartialEq, Component)]
#[derive(Component, Deref, Copy, Clone, Debug, Eq, Hash, PartialEq, Reflect)]
#[component(clone_behavior = Ignore)]
#[reflect(Component, Clone)]
pub struct RenderEntity(Entity);
impl RenderEntity {
#[inline]
@ -154,7 +155,8 @@ unsafe impl EntityEquivalent for RenderEntity {}
/// Component added on the render world entities to keep track of the corresponding main world entity.
///
/// Can also be used as a newtype wrapper for main world entities.
#[derive(Component, Deref, Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
#[derive(Component, Deref, Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Reflect)]
#[reflect(Component, Clone)]
pub struct MainEntity(Entity);
impl MainEntity {
#[inline]

View File

@ -175,6 +175,7 @@ impl Plugin for UiPlugin {
.register_type::<widget::Button>()
.register_type::<widget::Label>()
.register_type::<ZIndex>()
.register_type::<GlobalZIndex>()
.register_type::<Outline>()
.register_type::<BoxShadowSamples>()
.register_type::<UiAntiAlias>()