pub fn component_clone_via_reflect(
source: &SourceComponent<'_>,
ctx: &mut ComponentCloneCtx<'_, '_>,
)
Available on crate feature
bevy_reflect
only.Expand description
Component clone handler function implemented using reflect. Can be set as clone handler for any registered component, but only reflected components will be cloned.
To clone a component using this handler, the following must be true:
- World has
AppTypeRegistry
- Component has
TypeId
- Component is registered
- Component has
ReflectFromPtr
registered - Component can be cloned via
PartialReflect::reflect_clone
or has one of the following registered:ReflectFromReflect
,ReflectDefault
,ReflectFromWorld
If any of the conditions is not satisfied, the component will be skipped.
See EntityClonerBuilder
for details.