Scene related. Enum component can not be reflected. #4038
-
Is it correct to believe that enums can not be component and reflected? And wrapping enums with struct is the solution? DETAIL: In Reflection cleanup #1536, @Davier mentioned that
From what I gathered:
Which seems to mean that enums can not be used as components and reflected at the same time, because according to point number 3,
which causes the following panic:
What works: remove |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There's a draft PR to add reflection to enums here: #1347. Not sure about the status. |
Beta Was this translation helpful? Give feedback.
-
You can use #[derive(Component, Serialize, Deserialize, PartialEq, Eq, Hash, Clone, Copy, Reflect)]
#[reflect_value(Component, Serialize, Deserialize, PartialEq, Hash)] |
Beta Was this translation helpful? Give feedback.
You can use
#[reflect_value(Component)]
on enums: