Send instance_ready events when reloading scenes as well.

This commit is contained in:
andriyDev 2025-07-15 23:32:42 -07:00
parent 0c687143e3
commit 1b2ae8f11c

View File

@ -351,6 +351,10 @@ impl SceneSpawner {
Self::despawn_instance_internal(world, instance_info);
Self::spawn_sync_internal(world, *id, &mut instance_info.entity_map)?;
Self::set_scene_instance_parent_sync(world, instance_info);
// We trigger `SceneInstanceReady` events after processing all scenes
// SceneSpawner may not be available in the observer.
self.instances_ready
.push((*instance_id, instance_info.parent));
}
}
}
@ -377,6 +381,10 @@ impl SceneSpawner {
Self::despawn_instance_internal(world, instance_info);
Self::spawn_dynamic_internal(world, *id, &mut instance_info.entity_map)?;
Self::set_scene_instance_parent_sync(world, instance_info);
// We trigger `SceneInstanceReady` events after processing all scenes
// SceneSpawner may not be available in the observer.
self.instances_ready
.push((*instance_id, instance_info.parent));
}
}
}