Conversation
|
After going through all the code for this, I think |
|
I'll fix docs after we agree on the code, it's a pain to maintain at all time |
|
Not a full review yet but one note: Since fn foo<C: Spawn>(commands: C) -> C::SpawnOutput {
commands.spawn_empty()
.insert(...) // Error
.with_children(...) // Error
}This would require another trait, so if the plan is to do that in a separate PR that makes sense. |
|
I'm getting the easy traits out first, hopefully we can get a few in 0.14.1 The trait for |
|
Deferred vs immediate is already the case for |
|
|
||
| fn spawn(&mut self, bundle: impl Bundle) -> EntityWorldMut { | ||
| let entity = self.world.spawn((bundle, Parent(self.parent))).id(); | ||
| /// Spawns an entity with the given bundle and inserts it into the parent entity's [`Children`]. |
There was a problem hiding this comment.
Docs got swapped between spawn_empty and spawn.
|
Naming proposition:
Or something along these lines. Issue is, |
alice-i-cecile
left a comment
There was a problem hiding this comment.
I want to see a more cohesive overview of which traits would be used, and what they would be implemented for. I don't think this is wise to merge piecemeal, although I am in favor of the broad idea.
If we can't do it piecewise then this will turn into a large scale PR that will need to be for 0.15, in that case I'm closing the issue in favor of future discussion in #14231 with this as an example |
Objective
Solution
Spawntrait that providesspawn_emptyandspawnAPIWorld,Commands,WorldChildBuilderandChildBuilderMigration Guide
Spawnwas added tobevy::prelude, but will have to be included manually if prelude is not used.