AnimancerGraph Class

Summary

The root node which manages Animancer's UnityEngine.Playables.PlayableGraph.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
graph BT Type-->Base0["AnimancerNodeBase"] click Base0 "/animancer/api/Animancer/AnimancerNodeBase" Base0-->Base1["Object"] Type-.->Interface0["IAnimationClipCollection"] click Interface0 "/animancer/api/Animancer/IAnimationClipCollection" Type-.->Interface1["ICopyable<AnimancerGraph>"] Type-.->Interface2["IEnumerator"] Type-.->Interface3["IHasDescription"] click Interface3 "/animancer/api/Animancer/IHasDescription" Type["AnimancerGraph"] class Type type-node

Syntax

public class AnimancerGraph : AnimancerNodeBase, IAnimationClipCollection, 
    ICopyable<AnimancerGraph>, IEnumerator, IHasDescription

Remarks

This class can be used as a custom yield instruction to wait until all animations finish playing.

The most common way to access this class is via Animancer.AnimancerComponent.Graph.

Documentation: Playing Animations

Constructors

Name Summary
AnimancerGraph(PlayableGraph, TransitionLibrary) Creates an Animancer.AnimancerGraph in an existing UnityEngine.Playables.PlayableGraph.
AnimancerGraph(TransitionLibrary) Creates an Animancer.AnimancerGraph in a new UnityEngine.Playables.PlayableGraph.

Fields

Name Constant Value Summary
DefaultFadeDurationClass DefaultFadeDuration
[Editor-Only] The name that should be used for a class which sets the Animancer.AnimancerGraph.DefaultFadeDuration.
static
DefaultFadeDurationNamespace Animancer
[Editor-Only] The namespace that should be used for a class which sets the Animancer.AnimancerGraph.DefaultFadeDuration.
static
States
The Animancer.AnimancerStates managed by this graph.

Properties

Name Value Summary
ApplyAnimatorIK bool
Should Unity call OnAnimatorIK on the animated object while this object and its children have any Animancer.AnimancerNode.Weight?
ApplyFootIK bool
Should this object and its children apply IK to the character's feet?
ChildCount int
The number of nodes using this as their Animancer.AnimancerNodeBase.Parent.
Component IAnimancerComponent
The component that is playing this Animancer.AnimancerGraph.
Current AnimancerGraph
The graph currently being executed.
static
DefaultFadeDuration float
The fade duration to use if not specified. Default is 0.25.
static
DeltaTime float
The current UnityEngine.Playables.FrameData.deltaTime.
static
Disposables List<IDisposable>
A list of objects that need to be disposed when this Animancer.AnimancerGraph is destroyed.
EffectiveSpeed float
The Animancer.AnimancerNodeBase.Speed of this node multiplied by the Animancer.AnimancerNodeBase.Speed of each of its parents to determine the actual speed it's playing at.
Inherited from AnimancerNodeBase
Events NamedEventDictionary
A dictionary of callbacks to be triggered by any event with a matching name.
FrameID ulong
The current UnityEngine.Playables.FrameData.frameId.
Graph AnimancerGraph
The Animancer.AnimancerGraph containing this node.
Inherited from AnimancerNodeBase
HasEvents bool
Has the Animancer.AnimancerGraph.Events dictionary been initialized?
HasParameters bool
Has the Animancer.AnimancerGraph.Parameters dictionary been initialized?
IsGraphPlaying bool
Indicates whether the UnityEngine.Playables.PlayableGraph is currently playing.
KeepChildrenConnected bool
Should playables stay connected to the graph at all times? Otherwise they will be disconnected when their Animancer.AnimancerNode.Weight is 0.
Layer AnimancerLayer
The root Animancer.AnimancerLayer which this node is connected to (if any).
Layers AnimancerLayerList
The Animancer.AnimancerLayers which each manage their own set of animations.
Output PlayableOutput
The UnityEngine.Playables.PlayableOutput connected to this Animancer.AnimancerGraph.
Parameters ParameterDictionary
Dynamic parameters which anything can get or set.
Parent AnimancerNodeBase
The object which receives the output of the Animancer.AnimancerNodeBase.Playable.
Inherited from AnimancerNodeBase
Playable Playable
The internal object this node manages in the UnityEngine.Playables.PlayableGraph.
Inherited from AnimancerNodeBase
PlayableGraph PlayableGraph
[Pro-Only] The UnityEngine.Playables.PlayableGraph containing this Animancer.AnimancerGraph.
PostUpdatables IReadOnlyIndexedList<IUpdatable>
Objects to be updated after time advances.
PreUpdatables IReadOnlyIndexedList<IUpdatable>
Objects to be updated before time advances.
SkipFirstFade bool
Normally the first animation on the Base Layer should not fade in because there is nothing fading out. But sometimes that is undesirable, such as if the UnityEngine.Animator.runtimeAnimatorController is assigned since Animancer can blend with that.
Speed float
[Pro-Only] How fast the Animancer.AnimancerState.Time is advancing every frame (default 1).
Inherited from AnimancerNodeBase
Transitions TransitionLibrary
[Pro-Only] The optional Animancer.TransitionLibraries.TransitionLibrary this graph can use.
UpdateMode DirectorUpdateMode
Determines what time source is used to update the UnityEngine.Playables.PlayableGraph.

Methods

Name Value Summary
~AnimancerGraph() void
Calls Animancer.AnimancerGraph.OnGraphDestroyed in case Animancer.AnimancerGraph.Destroy wasn't called.
AddContextMenuIK(GenericMenu, AnimancerNodeBase) void
[Editor-Only] Adds functions to show and set Animancer.AnimancerNodeBase.ApplyAnimatorIK and Animancer.AnimancerNodeBase.ApplyFootIK.
Inherited from AnimancerNodeBase
static
AppendDescription(StringBuilder, string) void
Appends a detailed descrption of the current details of this object.
AppendGraphDetails(StringBuilder, string, string) void
Appends the structure of the Animancer.AnimancerGraph.PlayableGraph.
AppendInternalDetails(StringBuilder, string, string) void
Appends all registered Animancer.IUpdatables and System.IDisposables.
CancelPostUpdate(IUpdatable) void
Removes the `updatable` from the list of objects that need to be updated after the playebles.
CancelPreUpdate(IUpdatable) void
Removes the `updatable` from the list of objects that need to be updated before the playables.
ClearInactiveInitializationStackTrace(AnimancerGraph) void
[Editor-Only] [Internal] Discards the Animancer.AnimancerGraph.InactiveInitializationStackTrace.
static
CopyFrom(AnimancerGraph, bool) void
Copies all layers and states from `copyFrom` into this graph.
CopyFrom(AnimancerGraph, CloneContext, bool) void
Copies all layers and states from `copyFrom` into this graph.
CreateGraph() PlayableGraph
Creates a new empty UnityEngine.Playables.PlayableGraph and consumes the name set by Animancer.AnimancerGraph.SetNextGraphName(System.String) if it was called.
static
CreateOutput(Animator, IAnimancerComponent) void
Plays this playable on the specified `animator` and sets the Animancer.AnimancerGraph.Component.
CreateOutput(IAnimancerComponent) void
Plays this graph on the Animancer.IAnimancerComponent.Animator and sets the Animancer.AnimancerGraph.Component.
Destroy() void
Destroys the Animancer.AnimancerGraph.PlayableGraph and everything in it. This operation cannot be undone.
DestroyOutput() bool
Destroys the Animancer.AnimancerGraph.Output if it exists and returns true if successful.
DestroyPlayables() void
Destroys this Animancer.AnimancerGraph and everything inside it (layers, states, etc.) without destroying the Animancer.AnimancerGraph.PlayableGraph.
Evaluate() void
Evaluates all of the currently playing animations to apply their states to the animated objects.
Evaluate(float) void
Advances all currently playing animations by the specified amount of time (in seconds) and evaluates the graph to apply their states to the animated objects.
GatherAnimationClips(ICollection<AnimationClip>) void
[Animancer.IAnimationClipCollection] Gathers all the animations in all layers.
GetKey(AnimationClip) Object
Calls Animancer.IAnimancerComponent.GetKey(UnityEngine.AnimationClip) on the Animancer.AnimancerGraph.Component.
GetTotalWeight() float
Calculates the total Animancer.AnimancerNode.Weight of all states in all layers.
InsertOutputJob<T>(T) AnimationScriptPlayable
[Pro-Only] Inserts an animation job after the root of the Animancer.AnimancerGraph.PlayableGraph so that it can modify the final output.
InsertOutputPlayable(Playable) void
[Pro-Only] Inserts a `playable` after the root of the Animancer.AnimancerGraph.PlayableGraph so that it can modify the final output.
IsPlaying() bool
Is least one animation being played?
IsPlaying(AnimancerState) bool
[Warning] You should not use an Animancer.AnimancerState as a key. Just check Animancer.AnimancerState.IsPlaying.
IsPlaying(IHasKey) bool
Is a state registered with the Animancer.IHasKey.Key and currently playing?
IsPlaying(Object) bool
Is a state registered with the `key` and currently playing?
IsPlayingClip(AnimationClip) bool
Is the `clip` currently being played by at least one state in the specified layer?
IsValidOrDispose() bool
Is this Animancer.AnimancerGraph currently usable (not destroyed)?
MarkAsUsed(AnimancerNodeBase) void
[Assert-Conditional] Prevents the `node` from causing Animancer.OptionalWarning.UnusedNode.
Inherited from AnimancerNodeBase
static
OnChildIsLoopingChanged(bool) void
Called when a child's Animancer.AnimancerState.IsLooping value changes.
Inherited from AnimancerNodeBase
PauseGraph() void
Freezes the UnityEngine.Playables.PlayableGraph at its current state.

If you call this method, you are responsible for calling Animancer.AnimancerGraph.UnpauseGraph to resume playing.
RequirePostUpdate(IUpdatable) void
[Pro-Only] Adds the `updatable` to the list that need to be updated after the playables if it wasn't there already.
RequirePreUpdate(IUpdatable) void
[Pro-Only] Adds the `updatable` to the list that need to be updated before the playables if it wasn't there already.
SetKeepChildrenConnected(bool) void
Sets Animancer.AnimancerGraph.KeepChildrenConnected.
SetNextGraphName(string) void
[Editor-Conditional] Sets the display name for the next instance to give its UnityEngine.Playables.PlayableGraph.
static
Stop() void
Calls Animancer.AnimancerNode.Stop on all animations to stop them from playing and rewind them to the start.
Stop(AnimancerState) AnimancerState
[Warning] You should not use an Animancer.AnimancerState as a key. Just call Animancer.AnimancerNode.Stop.
Stop(IHasKey) AnimancerState
Gets the state registered with the Animancer.IHasKey.Key, stops and rewinds it to the start, then returns it.
Stop(Object) AnimancerState
Calls Animancer.AnimancerNode.Stop on the state registered with the `key` to stop it from playing and rewind it to the start.
ToString() string
[Editor-Only] Returns "Component Name (Animancer)".
UnpauseGraph() void
Resumes playing the UnityEngine.Playables.PlayableGraph if Animancer.AnimancerGraph.PauseGraph was called previously.

Operators

Name Value Summary
implicit operator PlayableGraph(AnimancerGraph) PlayableGraph