mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
SystemSet::before and after: take AsSystemLabel (#4503)
# Objective `AsSystemLabel` has been introduced on system descriptors to make ordering systems more convenient, but `SystemSet::before` and `SystemSet::after` still take `SystemLabels` directly: use bevy::ecs::system::AsSystemLabel; /*…*/ SystemSet::new().before(foo.as_system_label()) /*…*/ is currently necessary instead of /*…*/ SystemSet::new().before(foo) /*…*/ ## Solution Use `AsSystemLabel` for `SystemSet`
This commit is contained in:
parent
0fdb45ce90
commit
46acb7753c
1 changed files with 7 additions and 7 deletions
|
@ -1,9 +1,9 @@
|
||||||
use crate::schedule::{
|
use crate::schedule::{
|
||||||
AmbiguitySetLabel, BoxedAmbiguitySetLabel, BoxedSystemLabel, IntoRunCriteria,
|
AmbiguitySetLabel, BoxedAmbiguitySetLabel, BoxedSystemLabel, IntoRunCriteria,
|
||||||
RunCriteriaDescriptorOrLabel, State, StateData, SystemDescriptor, SystemLabel,
|
IntoSystemDescriptor, RunCriteriaDescriptorOrLabel, State, StateData, SystemDescriptor,
|
||||||
|
SystemLabel,
|
||||||
};
|
};
|
||||||
|
use crate::system::AsSystemLabel;
|
||||||
use super::IntoSystemDescriptor;
|
|
||||||
|
|
||||||
/// A builder for describing several systems at the same time.
|
/// A builder for describing several systems at the same time.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -95,14 +95,14 @@ impl SystemSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn before(mut self, label: impl SystemLabel) -> Self {
|
pub fn before<Marker>(mut self, label: impl AsSystemLabel<Marker>) -> Self {
|
||||||
self.before.push(Box::new(label));
|
self.before.push(Box::new(label.as_system_label()));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn after(mut self, label: impl SystemLabel) -> Self {
|
pub fn after<Marker>(mut self, label: impl AsSystemLabel<Marker>) -> Self {
|
||||||
self.after.push(Box::new(label));
|
self.after.push(Box::new(label.as_system_label()));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue