Skip to content
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

Add register type and some derive reflects #1

Merged
merged 2 commits into from May 23, 2023

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented May 22, 2023

For compatibility with bevy_inspector_egui, this could be handy ; maybe we should consider providing it behind a feature ? I'd say it's fine like that but I'll let you judge :)

@@ -126,15 +128,15 @@ pub enum AsPortalDestination {
}

/// Portal destination to be created
#[derive(Clone, Default)]
#[derive(Clone, Reflect, FromReflect, Default)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreatePortalDestination and AsPortalDestination might not need it there ; I tried to add it because I wanted to register_type for CreatePortal too, but Facefrom wgpu is preventing me to do it, not sure how to fix it right now

@Selene-Amanita
Copy link
Owner

Hi! As I said on discord I never used bevy_inspector_egui so I didn't know there was a need for that!

About adding Reflect to CreatePortal (and its children), I'm not sure it is very useful, as this component is supposed to be deleted before the next tick in a normal scenario, but it would be useful for those scenarios where the portal doesn't get created for whatever reason (I mean, it happened to me once, so...) I guess, and it's harmless to add it I guess.

What could be more useful is to add Reflect to the marker components Portal, PortalCamera and PortalDestination found in process.rs.

About Face: sadly it seems that the bevy team struggles with this too, but in the meantime they're just ignoring this field and I think we should do the same until they find a solution (code is the same on main, I checked): (https://docs.rs/bevy_pbr/0.10.1/src/bevy_pbr/pbr_material.rs.html#204-207).

Also, I'm curious: when bevy_inspector_egui encounters an Entity, does it automatically "link" to the entity it points to?

@Vrixyz
Copy link
Contributor Author

Vrixyz commented May 22, 2023

I think Reflect for the marker components are not much useful because they don't have fields, inspector_egui displays them alright.

for your curiosity: an entity encountered is nested into the field
image

@Selene-Amanita Selene-Amanita merged commit 2eec727 into Selene-Amanita:main May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants