bevy/crates/bevy_input
TehPers 2023ce63c7 Derive Reflect + FromReflect for input types (#6232)
# Objective

Adds support for reflecting many more of the input types. This allows those types to be used via scripting, `bevy-inspector-egui`, etc. These types are registered by the `InputPlugin` so that they're automatically available to anyone who wants to use them 

Closes #6223 

## Solution

Many types now have `#[derive(Reflect, FromReflect)]` added to them in `bevy_input`. Additionally, `#[reflect(traits...)]` has been added for applicable traits to the types.

This PR does not add reflection support for types which have private fields. Notably, `Touch` and `Touches` don't implement `Reflect`/`FromReflect`.

This adds the "glam" feature to the `bevy_reflect` dependency for package `bevy_input`. Since `bevy_input` transitively depends on `glam` already, all this brings in are the reflection `impl`s.

## Migration Guide

- `Input<T>` now implements `Reflect` via `#[reflect]` instead of `#[reflect_value]`. This means it now exposes its private fields via the `Reflect` trait rather than being treated as a value type. For code that relies on the `Input<T>` struct being treated as a value type by reflection, it is still possible to wrap the `Input<T>` type with a wrapper struct and apply `#[reflect_value]` to it.
  - As a reminder, private fields exposed via reflection are not subject to any stability guarantees.
---

## Changelog

Added
- Implemented `Reflect` + `FromReflect` for many input-related types. These types are automatically registered when adding the `InputPlugin`.
2022-10-26 19:52:20 +00:00
..
src Derive Reflect + FromReflect for input types (#6232) 2022-10-26 19:52:20 +00:00
Cargo.toml Derive Reflect + FromReflect for input types (#6232) 2022-10-26 19:52:20 +00:00