@@ -372,7 +372,17 @@ impl<'w> EntityWorldMut<'w> {
372372 /// For efficient spawning of multiple children, use [`with_children`].
373373 ///
374374 /// [`with_children`]: EntityWorldMut::with_children
375+ #[ deprecated = "Use spawn_child instead" ]
375376 pub fn with_child ( & mut self , bundle : impl Bundle ) -> & mut Self {
377+ self . spawn_child ( bundle)
378+ }
379+
380+ /// Spawns the passed bundle and adds it to this entity as a child.
381+ ///
382+ /// For efficient spawning of multiple children, use [`with_children`].
383+ ///
384+ /// [`with_children`]: EntityWorldMut::with_children
385+ pub fn spawn_child ( & mut self , bundle : impl Bundle ) -> & mut Self {
376386 let parent = self . id ( ) ;
377387 self . world_scope ( |world| {
378388 world. spawn ( ( bundle, ChildOf ( parent) ) ) ;
@@ -484,7 +494,17 @@ impl<'a> EntityCommands<'a> {
484494 /// For efficient spawning of multiple children, use [`with_children`].
485495 ///
486496 /// [`with_children`]: EntityCommands::with_children
497+ #[ deprecated = "Use spawn_child instead" ]
487498 pub fn with_child ( & mut self , bundle : impl Bundle ) -> & mut Self {
499+ self . spawn_child ( bundle)
500+ }
501+
502+ /// Spawns the passed bundle and adds it to this entity as a child.
503+ ///
504+ /// For efficient spawning of multiple children, use [`with_children`].
505+ ///
506+ /// [`with_children`]: EntityCommands::with_children
507+ pub fn spawn_child ( & mut self , bundle : impl Bundle ) -> & mut Self {
488508 self . with_related :: < ChildOf > ( bundle) ;
489509 self
490510 }
0 commit comments