Skip to content

Commit

Permalink
add EasingsLabel to coordinate new easings
Browse files Browse the repository at this point in the history
  • Loading branch information
blu-dev authored and mockersf committed Jun 8, 2024
1 parent d2e4916 commit c396754
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub use interpolation::EaseFunction;
pub use interpolation::Lerp;

mod plugin;
pub use plugin::{custom_ease_system, EasingsPlugin};
pub use plugin::{custom_ease_system, EasingsPlugin, EasingsLabel};
mod implemented;

/// Wrapper around a type that can be eased.
Expand Down
14 changes: 9 additions & 5 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ use crate::{
#[derive(Debug, Clone, Copy)]
pub struct EasingsPlugin;

/// Label to coordinate new easing spawns
#[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub struct EasingsLabel;

impl Plugin for EasingsPlugin {
fn build(&self, app: &mut App) {
app.add_systems(Update, ease_system::<Transform>);
app.add_systems(Update, ease_system::<Transform>.in_set(EasingsLabel));
#[cfg(feature = "sprite")]
app.add_systems(Update, ease_system::<Sprite>);
app.add_systems(Update, ease_system::<Sprite>.in_set(EasingsLabel));
#[cfg(feature = "ui")]
app.add_systems(Update, ease_system::<Style>);
app.add_systems(Update, ease_system::<Style>.in_set(EasingsLabel));
#[cfg(feature = "ui")]
app.add_systems(Update, ease_system::<BackgroundColor>);
app.add_systems(Update, ease_system::<BackgroundColor>.in_set(EasingsLabel));
#[cfg(feature = "ui")]
app.add_systems(Update, ease_system::<BorderColor>);
app.add_systems(Update, ease_system::<BorderColor>.in_set(EasingsLabel));
}
}

Expand Down

0 comments on commit c396754

Please sign in to comment.