mirror of
https://github.com/bevyengine/bevy
synced 2024-12-30 06:53:13 +00:00
a0a3d8798b
# Objective - Add an `ExtractResourcePlugin` for convenience and consistency ## Solution - Add an `ExtractResourcePlugin` similar to `ExtractComponentPlugin` but for ECS `Resource`s. The system that is executed simply clones the main world resource into a render world resource, if and only if the main world resource was either added or changed since the last execution of the system. - Add an `ExtractResource` trait with a `fn extract_resource(res: &Self) -> Self` function. This is used by the `ExtractResourcePlugin` to extract the resource - Add a derive macro for `ExtractResource` on a `Resource` with the `Clone` trait, that simply returns `res.clone()` - Use `ExtractResourcePlugin` wherever both possible and appropriate
19 lines
434 B
TOML
19 lines
434 B
TOML
[package]
|
|
name = "bevy_render_macros"
|
|
version = "0.8.0-dev"
|
|
edition = "2021"
|
|
description = "Derive implementations for bevy_render"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[lib]
|
|
proc-macro = true
|
|
|
|
[dependencies]
|
|
bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.8.0-dev" }
|
|
|
|
syn = "1.0"
|
|
proc-macro2 = "1.0"
|
|
quote = "1.0"
|