Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion crates/bevy_render/src/sync_world.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use bevy_app::Plugin;
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::component::{ComponentCloneBehavior, Mutable, StorageType};
use bevy_ecs::entity::EntityHash;
use bevy_ecs::{
component::Component,
Expand Down Expand Up @@ -126,7 +127,7 @@ 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(Component, Deref, Copy, Clone, Debug, Eq, Hash, PartialEq)]
#[derive(Deref, Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub struct RenderEntity(Entity);
impl RenderEntity {
#[inline]
Expand All @@ -135,6 +136,16 @@ impl RenderEntity {
}
}

impl Component for RenderEntity {
const STORAGE_TYPE: StorageType = StorageType::Table;

type Mutability = Mutable;

fn clone_behavior() -> ComponentCloneBehavior {
ComponentCloneBehavior::Ignore
}
}

impl From<Entity> for RenderEntity {
fn from(entity: Entity) -> Self {
RenderEntity(entity)
Expand Down