Skip to content

Commit 6d61103

Browse files
committed
parent_of -> children
1 parent 3cd3b4e commit 6d61103

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/animation/gltf_skinned_mesh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ fn joint_animation(
5858
// First joint is the second child of the mesh node.
5959
let first_joint_entity = mesh_node_parent[1];
6060
// Get `Children` in the first joint.
61-
let first_joint_parent_of = parents.get(first_joint_entity).unwrap();
61+
let first_joint_children = parents.get(first_joint_entity).unwrap();
6262

6363
// Second joint is the first child of the first joint.
64-
let second_joint_entity = first_joint_parent_of[0];
64+
let second_joint_entity = first_joint_children[0];
6565
// Get `Transform` in the second joint.
6666
let mut second_joint_transform = transform_query.get_mut(second_joint_entity).unwrap();
6767

examples/ecs/hierarchy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,22 @@ fn rotate(
6161
mut parents_query: Query<(Entity, &Children), With<Sprite>>,
6262
mut transform_query: Query<&mut Transform, With<Sprite>>,
6363
) {
64-
for (parent, parent_of) in &mut parents_query {
64+
for (parent, children) in &mut parents_query {
6565
if let Ok(mut transform) = transform_query.get_mut(parent) {
6666
transform.rotate_z(-PI / 2. * time.delta_secs());
6767
}
6868

6969
// To iterate through the entities children, just treat the Children component as a Vec
7070
// Alternatively, you could query entities that have a ChildOf component
71-
for child in parent_of {
71+
for child in children {
7272
if let Ok(mut transform) = transform_query.get_mut(*child) {
7373
transform.rotate_z(PI * time.delta_secs());
7474
}
7575
}
7676

7777
// To demonstrate removing children, we'll remove a child after a couple of seconds.
78-
if time.elapsed_secs() >= 2.0 && parent_of.len() == 2 {
79-
let child = parent_of.last().unwrap();
78+
if time.elapsed_secs() >= 2.0 && children.len() == 2 {
79+
let child = children.last().unwrap();
8080
commands.entity(*child).despawn();
8181
}
8282

examples/ui/ghost_nodes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ fn button_system(
119119
}
120120

121121
// Update button labels to match their parent counter
122-
for (parent_of, child_of) in &labels_query {
122+
for (children, child_of) in &labels_query {
123123
let counter = counter_query.get(child_of.get()).unwrap();
124-
let mut text = text_query.get_mut(parent_of[0]).unwrap();
124+
let mut text = text_query.get_mut(children[0]).unwrap();
125125

126126
**text = counter.0.to_string();
127127
}

0 commit comments

Comments
 (0)