chore: Restructure system schedule to more idiomatic Bevy 0.10 style.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b1c1e82866
commit
855fb714da
84
src/lib.rs
84
src/lib.rs
|
@ -693,9 +693,11 @@ fn events(
|
||||||
|
|
||||||
#[derive(SystemSet, Clone, Hash, Debug, PartialEq, Eq)]
|
#[derive(SystemSet, Clone, Hash, Debug, PartialEq, Eq)]
|
||||||
pub enum SynthizerSets {
|
pub enum SynthizerSets {
|
||||||
|
First,
|
||||||
UpdateHandles,
|
UpdateHandles,
|
||||||
UpdateProperties,
|
UpdateProperties,
|
||||||
UpdateState,
|
UpdateState,
|
||||||
|
Last,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
|
@ -756,70 +758,42 @@ impl Plugin for SynthizerPlugin {
|
||||||
.init_resource::<LastAudio>()
|
.init_resource::<LastAudio>()
|
||||||
.insert_resource(defaults)
|
.insert_resource(defaults)
|
||||||
.add_event::<SynthizerEvent>()
|
.add_event::<SynthizerEvent>()
|
||||||
.add_system(sync_config.in_base_set(CoreSet::PreUpdate))
|
.add_systems(
|
||||||
.add_system(
|
(sync_config, swap_buffers, change_panner_strategy)
|
||||||
swap_buffers
|
.in_set(SynthizerSets::First)
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
.in_base_set(CoreSet::PreUpdate),
|
||||||
.before(SynthizerSets::UpdateHandles),
|
|
||||||
)
|
)
|
||||||
.add_system(
|
.configure_set(SynthizerSets::First.before(SynthizerSets::UpdateHandles))
|
||||||
change_panner_strategy
|
.add_systems(
|
||||||
|
(add_source_handle, add_generator, add_sound_without_source)
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
.in_base_set(CoreSet::PostUpdate)
|
||||||
.before(SynthizerSets::UpdateHandles),
|
.in_set(SynthizerSets::UpdateHandles),
|
||||||
)
|
)
|
||||||
.add_system(
|
.configure_set(SynthizerSets::UpdateHandles.before(SynthizerSets::UpdateProperties))
|
||||||
add_source_handle
|
.add_systems(
|
||||||
|
(
|
||||||
|
update_listener,
|
||||||
|
update_source_properties,
|
||||||
|
update_sound_properties,
|
||||||
|
)
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
.in_base_set(CoreSet::PostUpdate)
|
||||||
.in_set(SynthizerSets::UpdateHandles)
|
.in_set(SynthizerSets::UpdateProperties),
|
||||||
.before(SynthizerSets::UpdateProperties),
|
|
||||||
)
|
)
|
||||||
.add_system(
|
.configure_set(
|
||||||
add_generator
|
SynthizerSets::UpdateProperties
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
.before(SynthizerSets::UpdateState)
|
||||||
.in_set(SynthizerSets::UpdateHandles)
|
.after(TransformSystem::TransformPropagate),
|
||||||
.before(SynthizerSets::UpdateProperties),
|
|
||||||
)
|
)
|
||||||
.add_system(
|
.add_systems(
|
||||||
add_sound_without_source
|
(update_source_playback_state, update_sound_playback_state)
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
|
||||||
.in_set(SynthizerSets::UpdateHandles)
|
|
||||||
.before(SynthizerSets::UpdateProperties),
|
|
||||||
)
|
|
||||||
.add_system(
|
|
||||||
update_listener
|
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
|
||||||
.in_set(SynthizerSets::UpdateProperties)
|
|
||||||
.after(TransformSystem::TransformPropagate)
|
|
||||||
.before(SynthizerSets::UpdateState),
|
|
||||||
)
|
|
||||||
.add_system(
|
|
||||||
update_source_properties
|
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
|
||||||
.in_set(SynthizerSets::UpdateProperties)
|
|
||||||
.after(TransformSystem::TransformPropagate)
|
|
||||||
.before(SynthizerSets::UpdateState),
|
|
||||||
)
|
|
||||||
.add_system(
|
|
||||||
update_sound_properties
|
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
|
||||||
.in_set(SynthizerSets::UpdateProperties)
|
|
||||||
.before(SynthizerSets::UpdateState),
|
|
||||||
)
|
|
||||||
.add_system(
|
|
||||||
update_source_playback_state
|
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
.in_base_set(CoreSet::PostUpdate)
|
||||||
.in_set(SynthizerSets::UpdateState),
|
.in_set(SynthizerSets::UpdateState),
|
||||||
)
|
)
|
||||||
.add_system(
|
.configure_set(SynthizerSets::UpdateState.before(SynthizerSets::Last))
|
||||||
update_sound_playback_state
|
.add_systems(
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
(remove_sound, events)
|
||||||
.in_set(SynthizerSets::UpdateState),
|
.in_set(SynthizerSets::Last)
|
||||||
)
|
.in_base_set(CoreSet::PostUpdate),
|
||||||
.add_system(remove_sound.in_base_set(CoreSet::PostUpdate))
|
|
||||||
.add_system(
|
|
||||||
events
|
|
||||||
.in_base_set(CoreSet::PostUpdate)
|
|
||||||
.after(SynthizerSets::UpdateState),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user