AnimancerNode Class

Summary

Base class for UnityEngine.Playables.Playable wrapper objects in Animancer.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
Derived Types
graph BT Type-->Base0["Key"] click Base0 "/animancer/api/Animancer/Key" Base0-->Base1["Object"] Type-.->Interface0["IKeyHolder"] click Interface0 "/animancer/api/Animancer/IKeyHolder" Type-.->Interface1["IEnumerable<AnimancerState>"] Type-.->Interface2["IEnumerator"] Type-.->Interface3["IPlayableWrapper"] click Interface3 "/animancer/api/Animancer/IPlayableWrapper" Type["AnimancerNode"] class Type type-node Derived0["AnimancerLayer"]-->Type click Derived0 "/animancer/api/Animancer/AnimancerLayer" Derived1["AnimancerState"]-->Type click Derived1 "/animancer/api/Animancer/AnimancerState"

Syntax

public abstract class AnimancerNode : Key, IKeyHolder, IEnumerable<AnimancerState>, IEnumerator, 
    IPlayableWrapper

Properties

Name Value Summary
ApplyAnimatorIK bool
[Animancer.IHasIK] Determines whether OnAnimatorIK(int layerIndex) will be called on the animated object while this node is active. The initial value is determined by Animancer.AnimancerPlayable.DefaultApplyAnimatorIK.

This is equivalent to the "IK Pass" toggle in Animator Controller layers.

Note that this property only applies to Animancer.ClipStates.
ApplyFootIK bool
[Animancer.IHasIK] Determines whether this node is applying IK to the character's feet. The initial value is determined by Animancer.AnimancerPlayable.DefaultApplyFootIK.

This is equivalent to the "Foot IK" toggle in Animator Controller states.
ChildCount int
The number of states using this node as their Animancer.AnimancerState.Parent.
EffectiveSpeed float
The Animancer.AnimancerNode.Speed of this node multiplied by the Animancer.AnimancerNode.Speed of each of its parents down the hierarchy (including the root Animancer.AnimancerPlayable.Speed) to determine the actual speed its output is being played at.
FadeSpeed float
The speed at which this node is fading towards the Animancer.AnimancerNode.TargetWeight.
Index int
The index of the port this node is connected to on the parent's UnityEngine.Playables.Playable.

A negative value indicates that it is not assigned to a port.
IsValid bool
Indicates whether the Animancer.AnimancerNode._Playable is usable (properly initialised and not destroyed).
KeepChildrenConnected bool
Indicates whether child playables should stay connected to this mixer at all times (default false).
Layer AnimancerLayer
The root Animancer.AnimancerLayer which this node is connected to.
Name string
[Editor-Only] The Inspector display name of this node.
Parent IPlayableWrapper
The object which receives the output of this node.
Root AnimancerPlayable
The Animancer.AnimancerPlayable at the root of the graph.
Speed float
[Pro-Only] How fast the Animancer.AnimancerState.Time is advancing every frame.

1 is the normal speed.

A negative value will play the animation backwards.
TargetWeight float
The desired Animancer.AnimancerNode.Weight which this node is fading towards according to the Animancer.AnimancerNode.FadeSpeed.
Weight float
The current blend weight of this node which determines how much it affects the final output. 0 has no effect while 1 applies the full effect of this node and values inbetween apply a proportional effect.

Setting this property cancels any fade currently in progress. If you don't wish to do that, you can use Animancer.AnimancerNode.SetWeight(System.Single) instead.

Animancer Lite only allows this value to be set to 0 or 1 in a runtime build.

Methods

Name Value Summary
AppendDescription(StringBuilder, int, string) void
Appends a detailed descrption of the current details of this node.
AppendDetails(StringBuilder, string) void
Called by Animancer.AnimancerNode.AppendDescription(System.Text.StringBuilder,System.Int32,System.String) to append the details of this node.
CreatePlayable() void
Creates and assigns the UnityEngine.Playables.Playable managed by this node.
CreatePlayable(Playable) void
Creates and assigns the UnityEngine.Playables.Playable managed by this node.
DestroyPlayable() void
Destroys the UnityEngine.Playables.Playable.
GetChild(int) AnimancerState
Returns the state connected to the specified `index` as a child of this node.
GetDescription(int, string) string
Returns a detailed descrption of the current details of this node.
GetEnumerator() IEnumerator<AnimancerState>
Gets an enumerator for all of this node's child states.
IndexOf(Key) int
Returns location of this object in the list (or -1 if it is not currently in a keyed list).
Inherited from Key
static
IsInList(Key) bool
Indicates whether the specified object is currently in a keyed list.
Inherited from Key
static
OnAddChild(IList<AnimancerState>, AnimancerState) void
Connects the `state` to this node at its Animancer.AnimancerNode.Index.
RecreatePlayable() void
Calls Animancer.AnimancerNode.DestroyPlayable and Animancer.AnimancerNode.CreatePlayable.
RecreatePlayableRecursive() void
Calls Animancer.AnimancerNode.RecreatePlayable on this node and all its children recursively.
RequireUpdate() void
Calls Animancer.AnimancerPlayable.RequireUpdate(Animancer.AnimancerNode) as long as the Animancer.AnimancerNode.Root is not null.
SetName(string) void
[Editor-Conditional] Sets the Inspector display name of this node. Animancer.AnimancerNode.ToString returns the name.
SetWeight(float) void
Sets the current blend weight of this node which determines how much it affects the final output. 0 has no effect while 1 applies the full effect of this node.

This method allows any fade currently in progress to continue. If you don't wish to do that, you can set the Animancer.AnimancerNode.Weight property instead.

Animancer Lite only allows this value to be set to 0 or 1 in a runtime build.
StartFade(float, float) void
Calls Animancer.AnimancerNode.OnStartFade and starts fading the Animancer.AnimancerNode.Weight over the course of the `fadeDuration` (in seconds).

If the `targetWeight` is 0 then Animancer.AnimancerNode.Stop will be called when the fade is complete.

If the Animancer.AnimancerNode.Weight is already equal to the `targetWeight` then the fade will end immediately.

Animancer Lite only allows a `targetWeight` of 0 or 1 and the default `fadeDuration` in a runtime build.
Stop() void
Stops the animation and makes it inactive immediately so it no longer affects the output. Sets Animancer.AnimancerNode.Weight = 0 by default.
ToString() string
The Inspector display name of this layer.

Extension Methods

Name Value Summary
CalculateEditorFadeDuration(float) float
Returns the duration of the `node`s current fade (if any), otherwise returns the `defaultDuration`.
IsValid() bool
Returns true if the `node` is not null and Animancer.AnimancerNode.IsValid.