SoloAnimation Class

Summary

Plays a single UnityEngine.AnimationClip on startup.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
  • IAnimationClipSource
Base Types
  • MonoBehaviour
graph BT Type-->Base0["MonoBehaviour"] Type-.->Interface0["IAnimationClipSource"] Type["SoloAnimation"] class Type type-node

Syntax

[AddComponentMenu(Strings.MenuPrefix + "Solo Animation")]
[DefaultExecutionOrder(-5000)]
[HelpURL(Strings.APIDocumentationURL + "/" + nameof(SoloAnimation))]
public sealed class SoloAnimation : MonoBehaviour, IAnimationClipSource

Attributes

Type Description
AddComponentMenu
DefaultExecutionOrder
HelpURLAttribute

Properties

Name Value Summary
Animator Animator
[UnityEngine.SerializeField] The UnityEngine.Animator component which this script controls.

If you need to set this value at runtime you are likely better off using a proper Animancer.AnimancerComponent.
Clip AnimationClip
[UnityEngine.SerializeField] The UnityEngine.AnimationClip which will be played by Animancer.SoloAnimation.OnEnable.

If you need to set this value at runtime you are likely better off using a proper Animancer.AnimancerComponent.
FootIK bool
[UnityEngine.SerializeField] Determines whether Foot IK will be applied to the model (if it is Humanoid).

The developers of Unity have states that they believe it looks better with this enabled, but more often than not it just makes the legs end up in a slightly different pose to what the animator intended.
IsInitialised bool
Indicates whether the UnityEngine.Playables.PlayableGraph is valid.
IsPlaying bool
Indicates whether the animation is playing (true) or paused (false).
NormalizedTime float
The Animancer.SoloAnimation.Time of this state as a portion of the UnityEngine.AnimationClip.length, meaning the value goes from 0 to 1 as it plays from start to end, regardless of how long that actually takes.

This value will continue increasing after the animation passes the end of its length and it will either freeze in place or start again from the beginning according to whether it is looping or not.

The fractional part of the value (NormalizedTime % 1) is the percentage (0-1) of progress in the current loop while the integer part ((int)NormalizedTime) is the number of times the animation has been looped.
Speed float
[UnityEngine.SerializeField] The speed at which the animation is playing (default 1).
StopOnDisable bool
If true, disabling this object will stop and rewind the animation. Otherwise it will simply be paused and will resume from its current state when it is re-enabled.

The default value is true.

This property wraps UnityEngine.Animator.keepAnimatorControllerStateOnDisable and inverts its value. The value is serialized by the UnityEngine.Animator.
Time float
The number of seconds that have passed since the start of the animation.

Methods

Name Value Summary
~SoloAnimation() void
[Editor-Only] Ensures that the UnityEngine.Playables.PlayableGraph is destroyed.
GetAnimationClips(List<AnimationClip>) void
[IAnimationClipSource] Adds the Animancer.SoloAnimation.Clip to the list.