mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
1da6720132
# Objective `ReflectResource` and `ReflectComponent` will panic on `apply` method if there is no such component. It's not very ergonomic. And not very good for performance since I need to check if such component exists first. ## Solution * Add `ReflectComponent::apply_or_insert` and `ReflectResource::apply_or_insert` functions. * Rename `ReflectComponent::add` into `ReflectComponent::insert` for consistency. --- ## Changelog ### Added * `ReflectResource::apply_or_insert` and `ReflectComponent::apply_on_insert`. ### Changed * Rename `ReflectComponent::add` into `ReflectComponent::insert` for consistency. * Use `ReflectComponent::apply_on_insert` in `DynamicScene` instead of manual checking. ## Migration Guide * Rename `ReflectComponent::add` into `ReflectComponent::insert`. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |