-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding derive Reflect for tick structs #11641
Adding derive Reflect for tick structs #11641
Conversation
crates/bevy_ecs/src/component.rs
Outdated
@@ -286,7 +287,7 @@ impl ComponentInfo { | |||
/// Given a type `T` which implements [`Component`], the `ComponentId` for `T` can be retrieved | |||
/// from a `World` using [`World::component_id()`] or via [`Components::component_id()`]. Access | |||
/// to the `ComponentId` for a [`Resource`] is available via [`Components::resource_id()`]. | |||
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq)] | |||
#[derive(Debug, Copy, Clone, Hash, Ord, PartialOrd, Eq, PartialEq, Reflect)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add the appropriate registrations (e.g. #[reflect(Hash, PartialEq)]
)?
Same for the other items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, should i add Clone
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is one for Clone
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also register these types into the App
(although I’m not sure if the bevy_ecs has a plugin or anything that would make sense to hold that logic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's no great spot to do this. Maybe bevy_core
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added them in bevy core, seems like a good place for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
# Objective - Deriving `Reflect` for some public ChangeDetection/Tick structs in bevy_ecs --------- Co-authored-by: Charles Bournhonesque <cbournhonesque@snapchat.com>
Looks like this wasn't feature-flagged correctly. |
Sorry about that, I think it should work now?
|
# Objective - Deriving `Reflect` for some public ChangeDetection/Tick structs in bevy_ecs --------- Co-authored-by: Charles Bournhonesque <cbournhonesque@snapchat.com>
Objective
Reflect
for some public ChangeDetection/Tick structs in bevy_ecs