Optional, additional utilities for the bevy_tween
-
First, you should add BevyTweenHelpersPlugin, to which you can add a logging function of your choice.
-
Then, register each of the following plugins for each interpolator type you wish to apply them to:
- AnimationParentDestroyerGenericPlugin
- Automatically despawns animation parents if it has no children left, for example a parent with no tweens
- You may also add EventAnimationParentTaggerPlugin to automatically tag animation parents to be destroyed even if they have event-emitting-tween children left
- Alternatively, you may also tag them manually by adding [AnimationParentToDestroyIfOnlyHasEventsLeft to them
- TweenTargetRemover
- Automatically removes entities from tween targets when their
AnimationTargetcomponent is removed - Listens to target removal tween requests and triggers
- Combining it with
AnimationParentDestroyerGenericPluginresults in automatic tween and parent clearing
- Automatically removes entities from tween targets when their
- TweenPriorityHandler
- Handles TweenPriorityToOthersOfType, when tweens or parents have this component, fight against other tweens of that type. The ones with the highest priority will survive.
- If you're not sure what the previous bullet means, read TweenPriorityToOthersOfType's description
- AnimationParentDestroyerGenericPlugin
-
A non generic plugin that you might useful is TweenSkipTaggerPlugin, which would listen to skip-tag requesting, allowing you to skip entire animations instead of tagging each tween in them
-
I also added my tween combinators, feel free to open PRs requesting to add your own!
An example for registering the plugins into your app would be:
app.add_plugins((
DefaultTweenPlugins, //from bevy_tween
BevyTweenHelpersPlugin::default(),
TweenTargetRemover::<MyGloriousInterpolator>::default(),
TweenPriorityHandler::<MyGloriousInterpolator>::default(),
AnimationParentDestroyerGenericPlugin::<MyGloriousInterpolator>::default(),
EventAnimationParentTaggerPlugin,
TweenSkipTaggerPlugin
))
.add_tween_systems(component_tween_system::<MyGloriousInterpolator>()); //from bevy_tweenbevy |
bevy_tween_helpers |
|---|---|
| 0.17 | 0.2 - 0.4 |
| 0.16 | 0.1 |
bevy_tweenThe crate this one is built upon.