bevy/crates/bevy_ecs/src/schedule
Giacomo Stevanato 309c3876bf
Replace FromWorld requirement on ReflectResource and reflect Resource for State<S> (#12136)
# Objective

- In #9623 I forgot to change the `FromWorld` requirement for
`ReflectResource`, fix that;
- Fix #12129

## Solution

- Use the same approach as in #9623 to try using `FromReflect` and
falling back to the `ReflectFromWorld` contained in the `TypeRegistry`
provided
- Just reflect `Resource` on `State<S>` since now that's possible
without introducing new bounds.

---

## Changelog

- `ReflectResource`'s `FromType<T>` implementation no longer requires
`T: FromWorld`, but instead now requires `FromReflect`.
- `ReflectResource::insert`, `ReflectResource::apply_or_insert` and
`ReflectResource::copy` now take an extra `&TypeRegistry` parameter.

## Migration Guide

- Users of `#[reflect(Resource)]` will need to also implement/derive
`FromReflect` (should already be the default).
- Users of `#[reflect(Resource)]` may now want to also add `FromWorld`
to the list of reflected traits in case their `FromReflect`
implementation may fail.
- Users of `ReflectResource` will now need to pass a `&TypeRegistry` to
its `insert`, `apply_or_insert` and `copy` methods.
2024-02-27 15:49:39 +00:00
..
executor Fix typos (#12131) 2024-02-26 17:46:01 +00:00
condition.rs Remove APIs deprecated in 0.13 (#11974) 2024-02-19 19:04:47 +00:00
config.rs fix some typos (#12038) 2024-02-22 18:55:22 +00:00
graph_utils.rs
mod.rs
schedule.rs Check cfg during CI and fix feature typos (#12103) 2024-02-25 15:19:27 +00:00
set.rs Fix SystemTypeSet::system_type being out of sync with System::type_id (#12030) 2024-02-21 23:40:45 +00:00
state.rs Replace FromWorld requirement on ReflectResource and reflect Resource for State<S> (#12136) 2024-02-27 15:49:39 +00:00
stepping.rs