bevy/crates/bevy_ecs/src/component
eugineerd 3caca428c0
allow EntityCloner to move components without Clone or Reflect (#20065)
# Objective
Fix #18079 

## Solution
- `EntityCloner` can now move components that don't have `Clone` or
`Reflect` implementation.
- Components with `ComponentCloneBehavior::Ignore` will not be moved.
- Components with `ComponentCloneBehavior::Custom` will be cloned using
their defined `ComponentCloneFn` and then removed from the source entity
to respect their `queue_deferred` logic.
- Relationships still need to be `Clone` or `Reflect` to be movable.
- Custom relationship data is now correctly preserved when cloned or
moved using `EntityCloner`.

## Testing
- Added new tests for moving components

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-14 22:33:01 +00:00
..
clone.rs allow EntityCloner to move components without Clone or Reflect (#20065) 2025-07-14 22:33:01 +00:00
info.rs Link ComponentIdFor in the ComponentId related docs (#20127) 2025-07-14 21:59:08 +00:00
mod.rs
register.rs Prevent TOCTOU bugs in ComponentsQueuedRegistrator (#20016) 2025-07-14 20:41:18 +00:00
required.rs
tick.rs