mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
2023ce63c7
# 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`.
25 lines
759 B
TOML
25 lines
759 B
TOML
[package]
|
|
name = "bevy_input"
|
|
version = "0.9.0-dev"
|
|
edition = "2021"
|
|
description = "Provides input functionality for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
default = []
|
|
serialize = ["serde"]
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.9.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.9.0-dev" }
|
|
bevy_math = { path = "../bevy_math", version = "0.9.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.9.0-dev" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.9.0-dev", features = ["glam"] }
|
|
|
|
# other
|
|
serde = { version = "1", features = ["derive"], optional = true }
|
|
thiserror = "1.0"
|