Expand description
§Using The Crate
- 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
- Automaitcally despawns animation parents tagged with
AnimationParentToDestroyIfOnlyHasEventsLeftif they only have event-emitting tweens left - If
EventAnimationParentTaggerPluginis added as well, automatically tags animation parents withAnimationParentToDestroyIfOnlyHasEventsLeftif they have event-emitting tweens
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
- Handles
- I also added my tween combinators, feel free to open PRs requesting to add your own!
§Example
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_tweenModules§
- animation_
parent_ destoryer - bevy_
tween_ helpers_ plugin - custom_
combinators - event_
animation_ parent_ tagger - extra_
transform_ tween_ makers - macros
- prelude
- target_
extractor - tween_
priority - tween_
request - tween_
skip_ tagger - tween_
target_ remover - utilities