-
-
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
Improve Components Hooks docs #12256
Comments
afonsolage
added
C-Docs
An addition or correction to our documentation
S-Needs-Triage
This issue needs to be labelled
labels
Mar 2, 2024
TrialDragon
added
A-ECS
Entities, components, systems, and events
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Mar 2, 2024
I agree with all these as improvements. In regards to |
github-merge-queue bot
pushed a commit
that referenced
this issue
Mar 4, 2024
# Objective - Closes #12256 ## Solution - Improved component hooks docs. - Improved component hooks example docs. --------- Co-authored-by: James Liu <[email protected]> Co-authored-by: Alice Cecile <[email protected]>
spectria-limina
pushed a commit
to spectria-limina/bevy
that referenced
this issue
Mar 9, 2024
# Objective - Closes bevyengine#12256 ## Solution - Improved component hooks docs. - Improved component hooks example docs. --------- Co-authored-by: James Liu <[email protected]> Co-authored-by: Alice Cecile <[email protected]>
mtsr
pushed a commit
to mtsr/bevy
that referenced
this issue
Mar 15, 2024
# Objective - Closes bevyengine#12256 ## Solution - Improved component hooks docs. - Improved component hooks example docs. --------- Co-authored-by: James Liu <[email protected]> Co-authored-by: Alice Cecile <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can Bevy's documentation be improved?
As someone who didn't followed closely #10756 I found a little confusing the different between
on_add
andon_insert
when just reading the examples and docs.Even tho I'm very eager to use component hooks (and we are closer to observers than relations) I think the docs and example could be improved a little bit:
ComponentHooks::on_add
should state that spawning an entity will triggeron_add
in the same way ason_remove
says that despawning an entity counts as removing all of its components.ComponentHooks::on_insert
should state that mutating a component will not triggeron_insert
like replacing the component will. I think this is important because in ECS, until now, there is no perceptual difference for the user between mutating a component or just replacing it. Now there is and users should be aware of that.component_hooks.rs
example should avoid using "advanced" terms without an easy explanation for the user, like:In this case I think we should "translate" what
not belogin to any created archtypes
means, like "Can't be already inserted to any entity" or something like that.component_hooks.rs
example should (maybe?) tell users thatEvents
should be prefered whenever applicable, since hooks can be more performance intensive or at least, more limited (I'm not sure about this one, tho)If that make sense, I can make a PR for that.
The text was updated successfully, but these errors were encountered: