mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +00:00
e1d741aa19
# Objective Ability to use `ReflectComponent` methods in dynamic type contexts with no access to `&World`. This problem occurred to me when wanting to apply reflected types to an entity where the `&World` reference was already consumed by query iterator leaving only `EntityMut`. ## Solution - Remove redundant `EntityMut` or `EntityRef` lookup from `World` and `Entity` in favor of taking `EntityMut` directly in `ReflectComponentFns`. - Added `RefectComponent::contains` to determine without panic whether `apply` can be used. ## Changelog - Changed function signatures of `ReflectComponent` methods, `apply`, `remove`, `contains`, and `reflect`. ## Migration Guide - Call `World::entity` before calling into the changed `ReflectComponent` methods, most likely user already has a `EntityRef` or `EntityMut` which was being queried redundantly. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |