-
Notifications
You must be signed in to change notification settings - Fork 15
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
Semi-automatic registration #52
Comments
I think we can look into that. As far as I'm aware, See bevyengine/bevy#3936 for a reference in upstream, links and discussion on the topic on a broader range |
Another option I looked into a while ago is moving trait registration into a method on the When I tried this I ran into issues because currently we rely on all trait components being registered at app startup, whereas with the approach I'm describing each component would only be registered the first time it's used in the World. There's likely a way to work around this, though I'm on my phone rn but I can go into more detail later if needed |
Uhhh, sounds jnteresting as well. I would be interested. But it would need to happen upstream, right? Anyways, I'd probably even try to make it happen there. |
We'd need to add a default method to the |
It is possible to make struct registration semi-automatic, using
inventory
crate. The solution simplifies registration a lot and does not require a centralized registration function with all the structs listed.A feature (which may not be enabled by default) can be introduced to toggle this, since it requires an additional dependency which may not be wanted.
It can be achieved using these three things:
#[register]
forimpl Trait for Struct
, which generates:The text was updated successfully, but these errors were encountered: