Skip to content

Commit

Permalink
Remove BevyTweenRegisterSystems
Browse files Browse the repository at this point in the history
  • Loading branch information
Multirious committed Jul 3, 2024
1 parent 6e3b0d2 commit a3e5cbb
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,35 +528,3 @@ pub enum TweenSystemSet {
/// - [`tween::tween_event_taking_system`]
ApplyTween,
}

/// Helper trait to add systems by this crate to your app and avoid mistake
/// from forgetting to use the intended schedule and set.
pub trait BevyTweenRegisterSystems {
/// Register tween systems
fn add_tween_systems<M>(
&mut self,
tween_systems: impl IntoSystemConfigs<M>,
) -> &mut Self;
}

impl BevyTweenRegisterSystems for App {
/// Register tween systems in schedule configured in [`TweenAppResource`]
/// in set [`TweenSystemSet::ApplyTween`]
///
/// # Panics
///
/// Panics if [`TweenAppResource`] does not exist in world.
fn add_tween_systems<M>(
&mut self,
tween_systems: impl IntoSystemConfigs<M>,
) -> &mut Self {
let app_resource = self
.world()
.get_resource::<TweenAppResource>()
.expect("`TweenAppResource` resource doesn't exist");
self.add_systems(
app_resource.schedule,
tween_systems.in_set(TweenSystemSet::ApplyTween),
)
}
}

0 comments on commit a3e5cbb

Please sign in to comment.