-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Document return behavior for child "spawning" commands. #21933
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
base: main
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| /// Spawns the passed bundle and adds it to this entity as a child. | ||
| /// Returns &mut [`EntityWorldMut`] for parent. |
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.
this is called on entity, and spawn the bundle as its child. so if we use the "parent" word here, it would be the parent of the first entity which doesn't make sense
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.
How do you think this could be better described?
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.
maybe "original entity" would be better than parent there? or "initial entity"?
| } | ||
|
|
||
| /// Spawns the passed bundle and adds it to this entity as a child. | ||
| /// Returns &mut [`EntityCommands`] for parent. |
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.
same
Objective
Document return behavior for child "spawning" commands.
Solution
Specifies that "with_child" functions return entity commands for the original parent and not the spawned child.
Testing
N/A
Showcase
While a showcase should aim to be brief and digestible, you can use a toggleable section to save space on longer showcases:
Click to view showcase