bevy/crates/bevy_ecs/src/world
Peter Hayman b8416b3043
Add some missing reflect attributes (#14259)
# Objective

- Some types are missing reflection attributes, which means we can't use
them in scene serialization etc.
- Effected types
   - `BorderRadius`
   - `AnimationTransitions`
   - `OnAdd`
   - `OnInsert`
   - `OnRemove`
- My use-case for `OnAdd` etc to derive reflect is 'Serializable
Observer Components'. Add the component, save the scene, then the
observer is re-added on scene load.

```rust
#[derive(Reflect)]
struct MySerializeableObserver<T: Event>(#[reflect(ignore)]PhantomData<T>);

impl<T: Event> Component for MySerializeableObserver<T> {
  const STORAGE_TYPE: StorageType  = StorageType::Table;
    fn register_component_hooks(hooks: &mut ComponentHooks) {
      hooks.on_add(|mut world, entity, _| {
        world
          .commands()
          .entity(entity)
          .observe(|_trigger: Trigger<T>| {
            println!("it triggered etc.");
          });
    });
  }
}
```

## Solution

- Add the missing traits

---
2024-07-22 18:24:10 +00:00
..
command_queue.rs improved error message when forgetting to call system apply function … (#13975) 2024-06-25 12:27:15 +00:00
component_constants.rs Add some missing reflect attributes (#14259) 2024-07-22 18:24:10 +00:00
deferred_world.rs Update trigger_observers to operate over slices of data (#14354) 2024-07-17 13:01:52 +00:00
entity_ref.rs Update trigger_observers to operate over slices of data (#14354) 2024-07-17 13:01:52 +00:00
error.rs Replace all labels with interned labels (#7762) 2023-10-25 21:39:23 +00:00
identifier.rs impl ExclusiveSystemParam for WorldId (#11164) 2024-01-01 15:59:53 +00:00
mod.rs Component Lifecycle Hook & Observer Trigger for replaced values (#14212) 2024-07-15 15:24:15 +00:00
spawn_batch.rs Generalised ECS reactivity with Observers (#10839) 2024-06-15 01:33:26 +00:00
unsafe_world_cell.rs Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00