bevy/crates/bevy_ui/src/widget/button.rs
Gino Valente 85c3251c10
bevy_ui: Add FromReflect derives (#8495)
# Objective

A lot of items in `bevy_ui` could be `FromReflect` but aren't. This
prevents users and library authors from being able to convert from a
`dyn Reflect` to one of these items.

## Solution

Derive `FromReflect` where possible. Also register the
`ReflectFromReflect` type data.
2023-04-26 12:17:23 +00:00

10 lines
349 B
Rust

use bevy_ecs::prelude::Component;
use bevy_ecs::reflect::ReflectComponent;
use bevy_reflect::std_traits::ReflectDefault;
use bevy_reflect::{FromReflect, Reflect, ReflectFromReflect};
/// Marker struct for buttons
#[derive(Component, Debug, Default, Clone, Copy, Reflect, FromReflect)]
#[reflect(Component, FromReflect, Default)]
pub struct Button;