Summary
A layer on which animations can play with their states managed independantly of other layers while blending the
output with those layers.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Interfaces
-
- ICopyable
<AnimancerNode> - IEnumerable
<AnimancerState> - IEnumerator
- IHasDescription
- I
Animation Clip Collection - ICopyable
<AnimancerLayer>
- ICopyable
- Base Types
-
- Object
- AnimancerNodeBase
- AnimancerNode
graph BT
Type-->Base0["AnimancerNode"]
click Base0 "/animancer/api/Animancer/AnimancerNode"
Base0-->Base1["AnimancerNodeBase"]
click Base1 "/animancer/api/Animancer/AnimancerNodeBase"
Base1-->Base2["Object"]
Type-.->Interface0["ICopyable<AnimancerNode>"]
Type-.->Interface1["IEnumerable<AnimancerState>"]
Type-.->Interface2["IEnumerator"]
Type-.->Interface3["IHasDescription"]
click Interface3 "/animancer/api/Animancer/IHasDescription"
Type-.->Interface4["IAnimationClipCollection"]
click Interface4 "/animancer/api/Animancer/IAnimationClipCollection"
Type-.->Interface5["ICopyable<AnimancerLayer>"]
Type["AnimancerLayer"]
class Type type-node
Syntax
public class AnimancerLayer : AnimancerNode, ICopyable<AnimancerNode>, IEnumerable<AnimancerState>,
IEnumerator, IHasDescription, IAnimationClipCollection, ICopyable<AnimancerLayer>
Remarks
This class can be used as a custom yield instruction to wait until all animations finish playing.
Documentation:
Layers
Fields
Name | Constant Value | Summary |
---|---|---|
DefaultCapacity |
The default
Animancer.AnimancerLayer.Capacity is 8 unless changed.static
|
Properties
Name | Value | Summary |
---|---|---|
ActiveStates | IReadOnlyIndexedList |
The states connected to this layer which are
Animancer.AnimancerState.IsActive . |
ApplyAnimatorIK | bool | |
ApplyFootIK | bool | |
Apply |
bool |
Should setting the
Animancer.AnimancerNodeBase.Parent
also set this node's Animancer.AnimancerNode.ApplyAnimatorIK to match it?
Default is true.
Inherited from AnimancerNode
static
|
ApplyParentFootIK | bool |
Should setting the
Animancer.AnimancerNodeBase.Parent
also set this node's Animancer.AnimancerNode.ApplyFootIK to match it?
Default is true.
Inherited from AnimancerNode
static
|
AverageVelocity | Vector3 |
The average velocity of the root motion of all currently playing animations, taking their current
Animancer.AnimancerNode.Weight into account.
|
Capacity | int |
The number of states that can be connected to this layer before its
UnityEngine.Playables.Playable needs to
allocate more inputs.
|
ChildCount | int |
The number of nodes using this as their
Animancer.AnimancerNodeBase.Parent . |
CommandCount | int |
The number of times the
Animancer.AnimancerLayer.CurrentState has changed. By storing this value and later comparing
the stored value to the current value, you can determine whether the state has been changed since then,
even it has changed back to the same state.
|
CurrentState | AnimancerState |
The state of the animation currently being played.
|
DebugName | Object |
[Assert-Only] The Inspector display name of this node.
Inherited from AnimancerNode
|
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
|
EffectiveWeight | float |
The
Animancer.AnimancerNode.Weight of this state multiplied by the Animancer.AnimancerNode.Weight of each of its parents down
the hierarchy to determine how much this state affects the final output.
Inherited from AnimancerNode
|
FadeGroup | FadeGroup |
The current fade being applied to this node (if any).
Inherited from AnimancerNode
|
FadeSpeed | float |
The speed at which this node is fading towards the
Animancer.AnimancerNode.TargetWeight .Inherited from AnimancerNode
|
Graph | AnimancerGraph |
The
Animancer.AnimancerGraph containing this node.Inherited from AnimancerNodeBase
|
Index | int |
The index of the port this node is connected to on the parent's
UnityEngine.Playables.Playable .Inherited from AnimancerNode
|
IsAdditive | bool |
[Pro-Only]
Determines whether this layer is set to additive blending. Otherwise it will override any earlier layers.
|
Keep |
bool |
Should child playables stay connected to the graph at all times?
|
Layer | AnimancerLayer |
A layer is its own root.
|
Mask | AvatarMask |
[Pro-Only] The mask that determines which bones this layer will affect.
|
MaxCloneCount | int |
The maximum number of duplicate states that can be created for a single clip when trying to get a
weightless state. Exceeding this limit will cause it to just use the state with the lowest weight.
Default = 3.
static
|
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
|
Speed | float |
[Pro-Only] How fast the
Animancer.AnimancerState.Time is advancing every frame (default 1).Inherited from AnimancerNodeBase
|
TargetWeight | float |
The desired
Animancer.AnimancerNode.Weight which this node is fading towards according to the
Animancer.AnimancerNode.FadeSpeed .
Inherited from AnimancerNode
|
this[int] | AnimancerState |
Returns the state connected to the specified `index` as a child of this layer.
|
TraceConstructor | bool |
[Assert-Only]
Should a
System.Diagnostics.StackTrace be captured in the constructor of all new nodes so
Animancer.OptionalWarning.UnusedNode can include it in the warning if that node ends up being unused?
Inherited from AnimancerNode
static
|
Weight | float |
The current blend weight of this node which determines how much it affects the final output.
Inherited from AnimancerNode
|
WeightlessThreshold | float |
The maximum
Animancer.AnimancerNode.Weight that Animancer.AnimancerLayer.GetOrCreateWeightlessState(Animancer.AnimancerState)
will treat as being weightless. Default = 0.1.
static
|
Methods
Name | Value | Summary |
---|---|---|
~AnimancerNode |
void |
[Assert-Only] Checks
Animancer.OptionalWarning.UnusedNode .Inherited from AnimancerNode
|
AddContextMenuIK |
void |
[Editor-Only]
Adds functions to show and set
Animancer.AnimancerNodeBase.ApplyAnimatorIK and
Animancer.AnimancerNodeBase.ApplyFootIK .
Inherited from AnimancerNodeBase
static
|
AppendDescription |
void |
Appends a detailed descrption of the current details of this object.
Inherited from AnimancerNode
|
AppendDetails |
void |
Called by
Animancer.AnimancerNode.AppendDescription(System.Text.StringBuilder,System.String) to append the details of this node. |
AppendIKDetails |
void |
Appends the details of
Animancer.AnimancerNodeBase.ApplyAnimatorIK and
Animancer.AnimancerNodeBase.ApplyFootIK .
Inherited from AnimancerNode
static
|
Assert |
void |
[Assert-Only]
Calls
Animancer.AnimancerNode.GetConnectionStatusError and logs the result if it isn't null .
Inherited from AnimancerNode
|
Assert |
void |
[Assert-Only] Calls
Animancer.AnimancerNode.AssertConnectionStatus for the `node` and all of its children.Inherited from AnimancerNode
static
|
CancelFade |
void |
Removes this node from the
Animancer.AnimancerNode.FadeGroup .Inherited from AnimancerNode
|
CopyFrom |
void |
Copies the details of `copyFrom` into this layer.
|
CopyFrom |
void |
Copies the details of `copyFrom` into this node, replacing its previous contents.
|
CopyIKFlags |
void |
Copies the IK settings from `copyFrom` into this node:
Inherited from AnimancerNode
|
CopyStatesFrom |
void |
Copies the details of all states in `copyFrom` to their equivalent states in this layer.
|
CreateIfNew |
void |
Calls
Animancer.AnimancerLayer.GetOrCreateState(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
If you only want to create a single state, use Animancer.AnimancerLayer.CreateState(UnityEngine.AnimationClip) .
|
CreateIfNew |
void |
Calls
Animancer.AnimancerLayer.GetOrCreateState(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
If you only want to create a single state, use Animancer.AnimancerLayer.CreateState(UnityEngine.AnimationClip) .
|
CreateIfNew |
void |
Calls
Animancer.AnimancerLayer.GetOrCreateState(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
If you only want to create a single state, use Animancer.AnimancerLayer.CreateState(UnityEngine.AnimationClip) .
|
CreateIfNew |
void |
Calls
Animancer.AnimancerLayer.GetOrCreateState(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
If you only want to create a single state, use Animancer.AnimancerLayer.CreateState(UnityEngine.AnimationClip) .
|
CreatePlayable |
void |
Creates and assigns the
UnityEngine.Playables.Playable managed by this node.Inherited from AnimancerNode
|
CreatePlayable |
void |
Creates and assigns the
UnityEngine.Animations.AnimationMixerPlayable managed by this layer. |
CreateState |
ClipState |
Creates and returns a new
Animancer.ClipState to play the `clip`. |
CreateState |
ClipState |
Creates and returns a new
Animancer.ClipState to play the `clip` and registers it with the `key`.
|
DestroyPlayable |
void |
Destroys the
UnityEngine.Playables.Playable .Inherited from AnimancerNode
|
DestroyStates |
void |
Destroys all states connected to this layer.
|
DisconnectChildSafe |
void |
Disconnects the
UnityEngine.Playables.Playable of the child at the specified `index` from this node.Inherited from AnimancerNode
|
GatherAnimationClips |
void |
[
Animancer.IAnimationClipCollection ]
Gathers all the animations in this layer.
|
GetChild |
AnimancerState |
Returns the state connected to the specified `index` as a child of this layer.
|
Get |
string |
Returns
null if this node is properly connected to its parent.
Otherwise, returns an error message to be logged.
Inherited from AnimancerNode
|
Get |
StackTrace |
[Assert-Only]
Returns the stack trace of the constructor (or null if
Animancer.AnimancerNode.TraceConstructor was false).
Inherited from AnimancerNode
static
|
GetEnumerator |
FastEnumerator |
Gets an enumerator for all of this node's child states.
|
GetOrCreateState |
AnimancerState |
Returns the `state` if it's a child of this layer. Otherwise makes a clone of it.
|
GetOrCreateState |
AnimancerState |
Calls
Animancer.AnimancerGraph.GetKey(UnityEngine.AnimationClip) and returns the state registered with that key or
creates one if it doesn't exist.
If the state already exists but has the wrong Animancer.AnimancerState.Clip , the `allowSetClip`
parameter determines what will happen. False causes it to throw an System.ArgumentException while
true allows it to change the Animancer.AnimancerState.Clip . Note that the change is somewhat costly to
performance to use with caution.
|
GetOrCreateState |
AnimancerState |
Returns the state registered with the
Animancer.IHasKey.Key if there is one. Otherwise
this method uses Animancer.ITransition.CreateState to create a new one and registers it with
that key before returning it.
|
GetOrCreateState |
AnimancerState |
Returns the state registered with the `key` or creates one if it doesn't exist.
|
Get |
AnimancerState |
If the `state`'s
Animancer.AnimancerNode.Weight is not currently low,
this method finds or creates a copy of it which is low.
The returned Animancer.AnimancerState.Time is also set to 0.
|
GetPath |
string |
Returns the hierarchy path of this node through its
Animancer.AnimancerNodeBase.Parent s.Inherited from AnimancerNode
|
GetState |
AnimancerState |
Returns a state registered with the `key` and attached to this layer or null if none exist.
|
GetTotalChildWeight |
float |
Calculates the total
Animancer.AnimancerNode.Weight of all states in this layer.
|
Increment |
void |
[Editor-Only] [Internal] Increases the
Animancer.AnimancerLayer.CommandCount by 1. |
IsAnyStatePlaying |
bool |
Returns true if at least one animation is being played.
|
Is |
bool |
Returns true if the
Animancer.AnimancerLayer.CurrentState is playing and hasn't yet reached its end.
This method is called by System.Collections.IEnumerator.MoveNext so this object can be used as a custom yield
instruction to wait until it finishes.
|
IsPlayingClip |
bool |
Returns true if the `clip` is currently being played by at least one state.
|
MarkAsUsed |
void |
[Assert-Conditional] Prevents the `node` from causing
Animancer.OptionalWarning.UnusedNode .Inherited from AnimancerNodeBase
static
|
On |
void |
Called when a child's
Animancer.AnimancerState.IsLooping value changes.Inherited from AnimancerNodeBase
|
Play |
AnimancerState |
Stops all other animations on the same layer, plays the `state`, and returns it.
|
Play |
AnimancerState |
Starts fading in the `state` over the course of the `fadeDuration` while fading out all others in this
layer. Returns the `state`.
|
Play |
AnimancerState |
Stops all other animations on this layer, plays the `clip`, and returns its state.
|
Play |
AnimancerState |
Starts fading in the `clip` over the course of the `fadeDuration`
while fading out all others in the same layer. Returns its state.
|
Play |
AnimancerState |
Creates a state for the `transition` if it didn't already exist, then calls
Animancer.AnimancerLayer.Play(Animancer.AnimancerState) or Animancer.AnimancerLayer.Play(Animancer.AnimancerState,System.Single,Animancer.FadeMode)
depending on the Animancer.ITransition.FadeDuration .
|
Play |
AnimancerState |
Creates a state for the `transition` if it didn't already exist, then calls
Animancer.AnimancerLayer.Play(Animancer.AnimancerState) or Animancer.AnimancerLayer.Play(Animancer.AnimancerState,System.Single,Animancer.FadeMode)
depending on the Animancer.ITransition.FadeDuration .
|
RecreatePlayable |
void |
Calls
Animancer.AnimancerNode.DestroyPlayable and Animancer.AnimancerNode.CreatePlayable .Inherited from AnimancerNode
|
Recreate |
void |
Calls
Animancer.AnimancerNode.RecreatePlayable on this node and all its children recursively.Inherited from AnimancerNode
|
SetDebugName |
void |
[Assert-Conditional] Sets the
Animancer.AnimancerNode.DebugName to display in the Inspector.Inherited from AnimancerNode
|
SetWeight |
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.
Inherited from AnimancerNode
|
StartFade |
void |
Calls
Animancer.AnimancerNode.OnStartFade and starts fading the Animancer.AnimancerNode.Weight over the course
of the Animancer.AnimancerGraph.DefaultFadeDuration (in seconds).
Inherited from AnimancerNode
|
StartFade |
void |
Calls
Animancer.AnimancerNode.OnStartFade and starts fading the Animancer.AnimancerNode.Weight
over the course of the `fadeDuration` (in seconds).
Inherited from AnimancerNode
|
Stop |
void |
Stops the animation and makes it inactive immediately so it no longer affects the output.
Inherited from AnimancerNode
|
ToString |
string |
The Inspector display name of this layer.
|
TryPlay |
AnimancerState |
Stops all other animations on this layer,
plays the animation registered with the `key`,
and returns the animation's state.
|
TryPlay |
AnimancerState |
Starts fading in the animation registered with the `key`
while fading out all others in the same layer over the course of the `fadeDuration`
and returns the animation's state.
|
TryPlay |
AnimancerState |
Stops all other animations on this layer,
plays the animation registered with the `key`,
and returns the animation's state.
|
TryPlay |
AnimancerState |
Starts fading in the animation registered with the `key`
while fading out all others in the same layer over the course of the `fadeDuration`
and returns the animation's state.
|
Extension Methods
Name | Value | Summary |
---|---|---|
Calculate |
float |
[Animancer Extension] [Editor-Only]
Returns the duration of the `node`s current fade (if any), otherwise returns the `defaultDuration`.
|
IsValid |
bool |
[Animancer Extension]
Is the `node` is not null and its
Animancer.AnimancerNodeBase.Playable valid?
From AnimancerUtilities
|