SoloAnimation Class

Summary

Plays a single UnityEngine.AnimationClip.
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")]
[AnimancerHelpUrl(typeof(SoloAnimation))]
[DefaultExecutionOrder(DefaultExecutionOrder)]
public class SoloAnimation : MonoBehaviour, IAnimationClipSource

Remarks

Documentation: Component Types

Sample: Doors

Attributes

Type Description
AddComponentMenu
AnimancerHelpUrlAttribute [Assert-Conditional] A UnityEngine.HelpURLAttribute which points to Animancer's documentation.
DefaultExecutionOrder

Fields

Name Constant Value Summary
DefaultExecutionOrder -5000
Initialize before anything else tries to use this component.
static

Properties

Name Value Summary
Animator Animator
[UnityEngine.SerializeField] The UnityEngine.Animator component which this script controls.
ApplyInEditMode bool
[Editor-Only] Should the Animancer.SoloAnimation.Clip be automatically applied to the object in Edit Mode?
Clip AnimationClip
[UnityEngine.SerializeField] The UnityEngine.AnimationClip that will be played.
IsInitialized bool
Indicates whether the UnityEngine.Playables.PlayableGraph is valid.
IsLooping bool
UnityEngine.Motion.isLooping
IsPlaying bool
Is the animation playing (true) or paused (false)?
Length float
UnityEngine.AnimationClip.length
NormalizedStartTime float
[UnityEngine.SerializeField] The normalized time that the animation will start at.
NormalizedTime float
[UnityEngine.SerializeField] 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.
Speed float
[UnityEngine.SerializeField] The speed at which the animation is playing (default 1).
StopOnDisable bool
Should disabling this object stop and rewind the animation? Otherwise, it will simply be paused and will resume from its current state when re-enabled.
Time float
[UnityEngine.SerializeField] 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.
Evaluate() void
Calls UnityEngine.Playables.PlayableGraph.Evaluate.
Evaluate(float) void
Calls UnityEngine.Playables.PlayableGraph.Evaluate(System.Single).
GetAnimationClips(List<AnimationClip>) void
[UnityEngine.IAnimationClipSource] Adds the Animancer.SoloAnimation.Clip to the list.
LateUpdate() void
Checks if the animation is done so it can pause the UnityEngine.Playables.PlayableGraph to improve performance.
OnDestroy() void
Ensures that the UnityEngine.Playables.PlayableGraph is properly cleaned up.
OnDisable() void
Stops playing and rewinds if Animancer.SoloAnimation.StopOnDisable.
OnEnable() void
Plays the Animancer.SoloAnimation.Clip on the target Animancer.SoloAnimation.Animator.
OnValidate() void
[Editor-Only] Applies the Animancer.SoloAnimation.Speed, FootIK, and Animancer.SoloAnimation.ApplyInEditMode.
Play() void
Plays the Animancer.SoloAnimation.Clip.
Play(AnimationClip) void
Plays the `clip`.
Reset() void
[Editor-Only] Tries to find an UnityEngine.Animator component on this UnityEngine.GameObject or its children or parents (in that order).