bevy/crates
Hennadii Chernyshchyk 1da6720132 Add apply_or_insert functions to reflected component and resources (#5201)
# 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`.
2022-07-11 14:11:24 +00:00
..
bevy_animation Hierarchy commandization (#4197) 2022-07-10 20:29:06 +00:00
bevy_app Remove the dependency cycles (#5171) 2022-07-04 13:04:18 +00:00
bevy_asset Derive default for enums where possible (#5158) 2022-07-01 03:42:15 +00:00
bevy_audio Remove the dependency cycles (#5171) 2022-07-04 13:04:18 +00:00
bevy_core Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_core_pipeline Make RenderStage::Extract run on the render world (#4402) 2022-07-08 23:56:33 +00:00
bevy_derive android - fix issues other than the rendering (#5130) 2022-06-30 19:42:45 +00:00
bevy_diagnostic Cleanups in diagnostics (#3871) 2022-06-20 17:02:25 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs Add apply_or_insert functions to reflected component and resources (#5201) 2022-07-11 14:11:24 +00:00
bevy_ecs_compile_fail_tests Fix rust 1.62 changes (#5154) 2022-06-30 19:24:28 +00:00
bevy_encase_derive Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
bevy_gilrs Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_gltf Allow rendering meshes without UV coordinate data. (#5222) 2022-07-08 20:55:08 +00:00
bevy_hierarchy Hierarchy commandization (#4197) 2022-07-10 20:29:06 +00:00
bevy_input Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
bevy_internal enable optional dependencies to stay optional (#5023) 2022-06-20 10:32:43 +00:00
bevy_log Remove the dependency cycles (#5171) 2022-07-04 13:04:18 +00:00
bevy_macro_utils bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
bevy_math Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
bevy_mikktspace Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
bevy_pbr Make RenderStage::Extract run on the render world (#4402) 2022-07-08 23:56:33 +00:00
bevy_ptr add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
bevy_reflect Make reflect_partial_eq return more accurate results (#5210) 2022-07-05 17:41:54 +00:00
bevy_render Extract resources into their target location (#5271) 2022-07-10 21:04:35 +00:00
bevy_scene Add apply_or_insert functions to reflected component and resources (#5201) 2022-07-11 14:11:24 +00:00
bevy_sprite Make RenderStage::Extract run on the render world (#4402) 2022-07-08 23:56:33 +00:00
bevy_tasks Miri can set thread names now (#5108) 2022-06-26 21:28:00 +00:00
bevy_text Make RenderStage::Extract run on the render world (#4402) 2022-07-08 23:56:33 +00:00
bevy_time add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
bevy_transform Hierarchy commandization (#4197) 2022-07-10 20:29:06 +00:00
bevy_ui Hierarchy commandization (#4197) 2022-07-10 20:29:06 +00:00
bevy_utils add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
bevy_window Move the configuration of the WindowPlugin to a resource (#5227) 2022-07-08 01:14:23 +00:00
bevy_winit Add option to center a window (#4999) 2022-07-04 13:04:14 +00:00