TrackerAnimation defines how an animation should be applied to a tracker, including priority, conditions, and lifecycle callbacks.
Package
Type Parameters
T- The type of tracker this animation applies to
Record Components
| Component | Type | Description |
|---|---|---|
name | String | The unique name of the animation |
priority | int | Animation priority (higher values take precedence) |
targetClass | Class<T> | The class type of the tracker |
applyCondition | Predicate<? super T> | Condition to check if animation can play |
modifierBuilder | Function<? super T, AnimationModifier> | Function providing animation modifier |
removeTask | Consumer<? super T> | Task run when animation is removed |
successTask | Consumer<? super T> | Task run when animation starts successfully |
fallbackTask | Consumer<? super T> | Task run when animation fails to start |
Static Methods
builder(String)
TrackerAnimation.
Parameters:
name- The name of the animation
Instance Methods
compareTo(TrackerAnimation)
Comparable<TrackerAnimation<T>>.
Builder Class
TheTrackerAnimation.Builder provides a fluent API for constructing tracker animations.
Builder Methods
type(Class)
newTargetClass- The new target class
priority(int)
priority- The priority value
check(Predicate)
applyCondition- The condition predicate
modifier(Function)
AnimationModifier.
Parameters:
modifierBuilder- Function providing the modifier
onRemove(Consumer)
removeTask- The removal task
onSuccess(Consumer)
successTask- The success task
onFallback(Consumer)
fallbackTask- The fallback task
build()
TrackerAnimation instance.
Returns: The constructed animation
Since: 2.2.0
Usage Examples
Basic Tracker Animation
Animation with Modifier
Animation with Lifecycle Hooks
Conditional Animation
Type-Specific Animation
Priority-Based Animation System
Animation with Dynamic Speed
Cleanup on Animation End
State-Based Animation
Animation Override System
See Also
- AnimationModifier - Animation playback modifier
- AnimationIterator - Animation loop behavior
- BlueprintAnimation - Complete animation data
- Tracker - Base tracker interface
