Skip to content

Commit

Permalink
Make spawn_dynamic return InstanceId (bevyengine#6663)
Browse files Browse the repository at this point in the history
# Objective

Fixes bevyengine#6661 

## Solution

Make `SceneSpawner::spawn_dynamic` return `InstanceId` like other functions there.

---

## Changelog

Make `SceneSpawner::spawn_dynamic` return `InstanceId` instead of `()`.
  • Loading branch information
DasLixou authored and taiyoungjang committed Dec 15, 2022
1 parent 40b28e9 commit 306d47c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_scene/src/scene_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ pub enum SceneSpawnError {
}

impl SceneSpawner {
pub fn spawn_dynamic(&mut self, scene_handle: Handle<DynamicScene>) {
pub fn spawn_dynamic(&mut self, scene_handle: Handle<DynamicScene>) -> InstanceId {
let instance_id = InstanceId::new();
self.dynamic_scenes_to_spawn
.push((scene_handle, instance_id));
instance_id
}

pub fn spawn_dynamic_as_child(
Expand Down

0 comments on commit 306d47c

Please sign in to comment.