Skip to content

Commit

Permalink
Use named field
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Jul 31, 2023
1 parent 302ffbf commit 2432b59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/bevy_scene/src/scene_spawner.rs
Expand Up @@ -16,7 +16,10 @@ use uuid::Uuid;
///
/// See also [`SceneSpawner::instance_is_ready`].
#[derive(Event)]
pub struct SceneInstanceReady(pub Entity);
pub struct SceneInstanceReady {
/// Entity to which the scene was spawned as a child.
pub parent: Entity,
}

/// Information about a scene instance.
#[derive(Debug)]
Expand Down Expand Up @@ -291,7 +294,8 @@ impl SceneSpawner {
child: entity,
}
.apply(world);
world.send_event(SceneInstanceReady(parent));

world.send_event(SceneInstanceReady { parent });
}
}
} else {
Expand Down

0 comments on commit 2432b59

Please sign in to comment.