AnimationState Type
Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies multiple animations on top of each other (layering).
See Applying Animations in the Spine Runtimes Guide.
Constructors
Constructor | Description |
|
|
Instance members
Instance member | Description |
Full Usage:
this.AddAnimation
Parameters:
int
animationName : string
loop : bool
delay : float32
Returns: TrackEntry
|
Queues an animation by name.
|
Full Usage:
this.AddAnimation
Parameters:
int
animation : Animation
loop : bool
delay : float32
-
If > 0, sets TrackEntry.Delay. If <= 0, the delay set is the duration of the previous track entry
minus any mix duration (from the AnimationStateData plus the specified Delay (ie the mix
ends at (Delay = 0) or before (Delay < 0) the previous track entry duration). If the
previous entry is looping, its next loop completion is used instead of its duration.
Returns: TrackEntry
A track entry to allow further customization of animation playback. References to the track entry must not be kept
after the AnimationState.Dispose event occurs.
|
Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is equivalent to calling AnimationState.SetAnimation.
|
Full Usage:
this.AddEmptyAnimation
Parameters:
int
-
Track number.
mixDuration : float32
-
Mix duration.
delay : float32
-
If > 0, sets TrackEntry.Delay. If <= 0, the delay set is the duration of the previous track entry
minus any mix duration plus the specified Delay (ie the mix ends at (Delay = 0) or
before (Delay < 0) the previous track entry duration). If the previous entry is looping, its next
loop completion is used instead of its duration.
Returns: TrackEntry
A track entry to allow further customization of animation playback. References to the track entry must not be kept
after the AnimationState.Dispose event occurs.
|
Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's TrackEntry.MixDuration. If the track is empty, it is equivalent to calling AnimationState.SetEmptyAnimation.
|
|
|
Full Usage:
this.Apply
Parameters:
Skeleton
Returns: bool
True if any animations were applied.
|
Poses the skeleton using the track entry animations. The animation state is not changed, so can be applied to multiple skeletons to pose them identically.
|
Full Usage:
this.ApplyEventTimelinesOnly
Parameters:
Skeleton
?issueEvents : bool
-
When set to false, only animation times of TrackEntries are updated.
Returns: bool
|
Version of AnimationState.Apply only applying and updating time at EventTimelines for lightweight off-screen updates.
|
|
|
Full Usage:
this.ClearListenerNotifications
|
Discards all listener notifications that have not yet been delivered. This can be useful to call from an AnimationState event subscriber when it is known that further notifications that may have been already queued for delivery are not wanted because new animations are being set. |
|
|
Full Usage:
this.ClearTrack
Parameters:
int
|
Removes all animations from the track, leaving skeletons in their current pose. It may be desired to use AnimationState.SetEmptyAnimation to mix the skeletons back to the setup pose, rather than leaving them in their current pose.
|
Full Usage:
this.ClearTracks
|
Removes all animations from all tracks, leaving skeletons in their current pose. It may be desired to use AnimationState.SetEmptyAnimations to mix the skeletons back to the setup pose, rather than leaving them in their current pose. |
|
See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.
|
Full Usage:
this.Data
|
|
|
See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.
|
|
See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.
|
|
|
Full Usage:
this.GetCurrent
Parameters:
int
Returns: TrackEntry
The track entry for the animation currently playing on the track, or null if no animation is currently playing.
|
|
|
See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.
|
Full Usage:
this.SetAnimation
Parameters:
int
animationName : string
loop : bool
Returns: TrackEntry
|
|
Full Usage:
this.SetAnimation
Parameters:
int
animation : Animation
loop : bool
-
If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
duration. In either caseTrackEntry.TrackEnd determines when the track is cleared.
Returns: TrackEntry
A track entry to allow further customization of animation playback. References to the track entry must not be kept
after the AnimationState.Dispose event occurs.
|
Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).
|
Full Usage:
this.SetEmptyAnimation
Parameters:
int
mixDuration : float32
Returns: TrackEntry
|
Sets an empty animation for a track, discarding any queued animations, and sets the track entry's !:TrackEntry.getMixDuration(). An empty animation has no timelines and serves as a placeholder for mixing in or out. Mixing out is done by setting an empty animation with a mix duration using either AnimationState.SetEmptyAnimation, AnimationState.SetEmptyAnimations, or AnimationState.AddEmptyAnimation. Mixing to an empty animation causes the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of 0 still mixes out over one frame. Mixing in is done by first setting an empty animation, then adding an animation using AnimationState.AddAnimation with the desired delay (an empty animation has a duration of 0) and on the returned track entry, set the !:TrackEntry.SetMixDuration(float). Mixing from an empty animation causes the new animation to be applied more and more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the setup pose value if no lower tracks key the property to the value keyed in the new animation.
|
Full Usage:
this.SetEmptyAnimations
Parameters:
float32
|
Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.
|
|
See for details. Usage in C# and spine-unity is explained on the spine-unity documentation pages.
|
Full Usage:
this.TimeScale
|
Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower or faster. Defaults to 1. See TrackEntry TrackEntry.TimeScale for affecting a single animation. |
Full Usage:
this.ToString
Returns: string
Modifiers: abstract |
|
|
A list of tracks that have animations, which may contain nulls.
|
Full Usage:
this.Update
Parameters:
float32
-
delta time
|
|