-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Document part of bevy_ecs::Commands #976
Conversation
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.
Since latest rust version you can use easy intra doc links: https://doc.rust-lang.org/stable/rustdoc/linking-to-items-by-name.html
Could you link all items that make sense? (like the "See something
")
for |
self | ||
} | ||
|
||
/// Equivalent to iterating of `components_iter` and calling `spawn` on each bundle, but slightly more performant. |
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.
Is this correct? I'm basing this off of the method signature, but World::spawn_batch
's docs seem to imply that I
should be an iterator of Component
rather than Bundle
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.
@cart I wonder if you can help clarify this for me?
"local resources" are resources created for a specific system. SystemId is a unique identifier for a system.
I'm guessing the author intended "other considerations" to be "children" (to contrast with the despawn_recursive command). I personally think we should just cut out that phrasing. We should just describe what despawning a specified entity does. We don't need to care about describing what it doesn't do. |
It may be worth adding |
Here is a first pass at adding some clarification to
Commands
, which is a type that most folks need to use and can sometimes be confusing. This is not meant to be a "final draft" but are intended just to help answer some common questions for new users before bevy has more thorough docs.I've specifically tried to address which methods should be called with bundles vs single components. This changeset renames some usages of
components
tobundle
.I'd also like to document the following, but need some further guidance for:
insert_local_resource
: I'm unsure whatSystemId
is in relation toResources
(is it just like a namespace for archetypes?)despawn
: I'd like to clarify what "other considerations" the existing comment is referring to (currently documented as:Despawns only the specified entity, ignoring any other consideration.
)