Update ChildOf
deprecation advice to match new layout (#18089)
https://github.com/bevyengine/bevy/pull/17905 replaced `ChildOf(entity)` with `ChildOf { parent: entity }`, but some deprecation advice was overlooked. Also corrected formatting in documentation. ## Testing Added a `set_parent` to a random example. Confirmed that the deprecation warning shows and the advice can be pasted in.
This commit is contained in:
parent
e43b28c1ec
commit
780f658f2c
@ -200,7 +200,10 @@ impl<'w> EntityWorldMut<'w> {
|
||||
}
|
||||
|
||||
/// Inserts the [`ChildOf`] component with the given `parent` entity, if it exists.
|
||||
#[deprecated(since = "0.16.0", note = "Use entity_mut.insert(ChildOf(entity))")]
|
||||
#[deprecated(
|
||||
since = "0.16.0",
|
||||
note = "Use entity_mut.insert(ChildOf { parent: entity })"
|
||||
)]
|
||||
pub fn set_parent(&mut self, parent: Entity) -> &mut Self {
|
||||
self.insert(ChildOf { parent });
|
||||
self
|
||||
@ -246,7 +249,10 @@ impl<'a> EntityCommands<'a> {
|
||||
}
|
||||
|
||||
/// Inserts the [`ChildOf`] component with the given `parent` entity, if it exists.
|
||||
#[deprecated(since = "0.16.0", note = "Use entity_commands.insert(ChildOf(entity))")]
|
||||
#[deprecated(
|
||||
since = "0.16.0",
|
||||
note = "Use entity_commands.insert(ChildOf { parent: entity })"
|
||||
)]
|
||||
pub fn set_parent(&mut self, parent: Entity) -> &mut Self {
|
||||
self.insert(ChildOf { parent });
|
||||
self
|
||||
|
Loading…
Reference in New Issue
Block a user