Skip to content

Commit cabf170

Browse files
authored
add EventEmittingTween required components to all TweenEventDatas (#73)
1 parent a7af4a2 commit cabf170

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/tween_event.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ impl PluginGroup for DefaultTweenEventPlugins {
7878
/// Fires [`TweenEvent`] whenever [`TimeSpanProgress`] and [`TweenEventData`] exist in the same entity.
7979
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Component, Reflect)]
8080
#[reflect(Component)]
81+
#[require(EventEmittingTween)]
8182
pub struct TweenEventData<Data = ()>(pub Data)
8283
where
8384
Data: Send + Sync + 'static;
8485

86+
/// Used to mark event-emitting tweens (tweens with `TweenEventData<Data>` for some registered `Data`)
87+
#[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Component, Reflect)]
88+
#[reflect(Component)]
89+
pub struct EventEmittingTween;
90+
8591
impl<Data: Send + Sync + 'static> TweenEventData<Data> {
8692
/// Create new [`TweenEventData`] with custom user data.
8793
pub fn with_data(data: Data) -> Self {

0 commit comments

Comments
 (0)