bevy/crates/bevy_render
Thomas Wilgenbus 4ae6a66481
Allow optional extraction of resources from the main world (#10109)
# Objective

From my understanding, although resources are not meant to be created
and removed at every frame, they are still meant to be created
dynamically during the lifetime of the App.
But because the extract_resource API does not allow optional resources
from the main world, it's impossible to use resources in the render
phase that were not created before the render sub-app itself.

## Solution

Because the ECS engine already allows for system parameters to be
`Option<Res>`, it just had to be added.

---

## Changelog

- Changed
    - `extract_resource` now takes an optional main world resource

- Fixed
- `ExtractResourcePlugin` doesn't cause panics anymore if the resource
is not already inserted
2023-10-14 16:07:49 +00:00
..
macros Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
src Allow optional extraction of resources from the main world (#10109) 2023-10-14 16:07:49 +00:00
Cargo.toml wgpu 0.17 (#9302) 2023-10-09 20:15:24 +00:00