diff --git a/crates/bevy_ecs/src/identifier/mod.rs b/crates/bevy_ecs/src/identifier/mod.rs index 66ff28af43..04a93cde45 100644 --- a/crates/bevy_ecs/src/identifier/mod.rs +++ b/crates/bevy_ecs/src/identifier/mod.rs @@ -3,6 +3,9 @@ //! or other IDs that can be packed and expressed within a `u64` sized type. //! [`Identifier`]s cannot be created directly, only able to be converted from other //! compatible IDs. +#[cfg(feature = "bevy_reflect")] +use bevy_reflect::Reflect; + use self::{error::IdentifierError, kinds::IdKind, masks::IdentifierMask}; use std::{hash::Hash, num::NonZeroU32}; @@ -15,6 +18,8 @@ pub(crate) mod masks; /// segment, a 31-bit high segment, and the significant bit reserved as type flags to denote /// entity kinds. #[derive(Debug, Clone, Copy)] +#[cfg_attr(feature = "bevy_reflect", derive(Reflect))] +#[cfg_attr(feature = "bevy_reflect", reflect_value(Debug, Hash, PartialEq))] // Alignment repr necessary to allow LLVM to better output // optimised codegen for `to_bits`, `PartialEq` and `Ord`. #[repr(C, align(8))]