fn scene_update(
    mut commands: Commands,
    scene_spawner: Res<SceneSpawner>,
    scene_instance: Res<SceneInstance>,
    mut done: Local<bool>,
) {
    if !*done {
        if let Some(instance_id) = scene_instance.0 {
            if let Some(entity_iter) = scene_spawner.iter_instance_entities(instance_id) {
                entity_iter.for_each(|entity| {
                    commands.entity(entity).insert(EntityInMyScene);
                });
                *done = true;
            }
        }
    }
}
// This system will wait for the scene to be ready, and then tag entities from
// the scene with `EntityInMyScene`. All entities from the second scene will be
// tagged
This system will wait for the scene to be ready, and then tag entities from
the scene with `EntityInMyScene`. All entities from the second scene will be
tagged
This system will wait for the scene to be ready and then tag entities from the scene with ` EntityInMyScene ` . All entities from the second scene will be tagged
fn scene_update(
    mut commands: Commands,
    scene_spawner: Res<SceneSpawner>,
    scene_instance: Res<SceneInstance>,
    mut done: Local<bool>,
) {
    if !*done {
        if let Some(instance_id) = scene_instance.0 {
            if let Some(entity_iter) = scene_spawner.iter_instance_entities(instance_id) {
                entity_iter.for_each(|entity| {
                    commands.entity(entity).insert(EntityInMyScene);
                });
                *done = true;
            }
        }
    }
}
fn scene_update ( mut commands : Commands , scene_spawner : Res < SceneSpawner > , scene_instance : Res < SceneInstance > , mut done : Local < bool > , ) { if ! * done { if let Some ( instance_id ) = scene_instance . 0 { if let Some ( entity_iter ) = scene_spawner . iter_instance_entities ( instance_id ) { entity_iter . for_each ( | entity | { commands . entity ( entity ) . insert ( EntityInMyScene ) ; } ) ; * done = true ; } } } }
This system will wait for the scene to be ready, and then tag entities from
the scene with `EntityInMyScene`.
This system will wait for the scene to be ready and then tag entities from the scene with ` EntityInMyScene ` .
commands
Commands
scene_spawner
Res<SceneSpawner>
scene_instance
Res<SceneInstance>
done
Local<bool>
commands
Commands
scene_spawner
Res<SceneSpawner>
scene_instance
Res<SceneInstance>
done
Local<bool>