AnimancerStateDictionary Class

Summary

A dictionary of Animancer.AnimancerStates mapped to their Animancer.AnimancerState.Key.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IAnimationClipCollection"] click Interface0 "/animancer/api/Animancer/IAnimationClipCollection" Type-.->Interface1["IEnumerable<AnimancerState>"] Type["AnimancerStateDictionary"] class Type type-node

Syntax

public class AnimancerStateDictionary : IAnimationClipCollection, IEnumerable<AnimancerState>

Remarks

Documentation: States

Properties

Name Value Summary
Count int
The number of states that have been registered with a Animancer.AnimancerState.Key.
Current AnimancerState
The Animancer.AnimancerLayer.CurrentState on layer 0.

Specifically, this is the state that was most recently started using any of the Play methods on that layer. States controlled individually via methods in the Animancer.AnimancerState itself will not register in this property.
this[AnimancerState] AnimancerState
[Warning] You should not use an Animancer.AnimancerState as a key. The whole point of a key is to identify a state in the first place.
this[AnimationClip] AnimancerState
Calls Animancer.AnimancerGraph.GetKey(UnityEngine.AnimationClip) then returns the state registered with that key.
this[IHasKey] AnimancerState
Returns the state registered with the Animancer.IHasKey.Key.
this[Object] AnimancerState
Returns the state registered with the `key`.

Methods

Name Value Summary
AppendDescriptionOrOrphans(StringBuilder, string) void
Create(AnimationClip) ClipState
Creates and returns a new Animancer.ClipState to play the `clip`.
Create(Object, AnimationClip) ClipState
Creates and returns a new Animancer.ClipState to play the `clip` and registers it with the `key`.
CreateIfNew(AnimationClip, AnimationClip) void
Calls Animancer.AnimancerStateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip, AnimationClip, AnimationClip) void
Calls Animancer.AnimancerStateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip, AnimationClip, AnimationClip, AnimationClip) void
Calls Animancer.AnimancerStateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip[]) void
Calls Animancer.AnimancerStateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified `clips`.
Destroy(AnimancerState) bool
[Warning] You should not use an Animancer.AnimancerState as a key. Just call Animancer.AnimancerState.Destroy.
Destroy(AnimationClip) bool
Calls Animancer.AnimancerState.Destroy on the state associated with the `clip` (if any). Returns true if the state existed.
Destroy(IHasKey) bool
Calls Animancer.AnimancerState.Destroy on the state associated with the Animancer.IHasKey.Key (if any). Returns true if the state existed.
Destroy(Object) bool
Calls Animancer.AnimancerState.Destroy on the state associated with the `key` (if any). Returns true if the state existed.
DestroyAll(IAnimationClipCollection) void
Calls Animancer.AnimancerStateDictionary.Destroy(UnityEngine.AnimationClip) on all states gathered by Animancer.IAnimationClipCollection.GatherAnimationClips(System.Collections.Generic.ICollection{UnityEngine.AnimationClip}).
DestroyAll(IAnimationClipSource) void
Calls Animancer.AnimancerStateDictionary.Destroy(UnityEngine.AnimationClip) on all states gathered by UnityEngine.IAnimationClipSource.GetAnimationClips(System.Collections.Generic.List{UnityEngine.AnimationClip}).
DestroyAll(IEnumerable<AnimationClip>) void
Calls Animancer.AnimancerStateDictionary.Destroy(UnityEngine.AnimationClip) on each of the `clips`.
DestroyAll(IList<AnimationClip>) void
Calls Animancer.AnimancerStateDictionary.Destroy(UnityEngine.AnimationClip) on each of the `clips`.
GatherAnimationClips(ICollection<AnimationClip>) void
[Animancer.IAnimationClipCollection] Adds all the animations of states with a Animancer.AnimancerState.Key to the `clips`.
GetClipMismatchError(Object, AnimationClip, AnimationClip) string
Returns an error message explaining that a state already exists with the specified `key`.
static
GetEnumerator() Dictionary<Object, AnimancerState>.ValueCollection.Enumerator
Returns an enumerator that will iterate through all registered states.
GetOrCreate(AnimancerState, AnimationClip) AnimancerState
[Warning] You should not use an Animancer.AnimancerState as a key. The whole point of a key is to identify a state in the first place.
GetOrCreate(AnimationClip, bool) AnimancerState
Calls Animancer.AnimancerGraph.GetKey(UnityEngine.AnimationClip) and returns the state registered with that key or creates one if it doesn't exist.
GetOrCreate(ITransition) AnimancerState
Returns the state registered with the `transition`s 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.
GetOrCreate(Object, AnimationClip, bool) AnimancerState
Returns the state which registered with the `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 so use with caution.
TryGet(AnimancerState, AnimancerState) bool
[Warning] You should not use an Animancer.AnimancerState as a key. The whole point of a key is to identify a state in the first place.
TryGet(AnimationClip, AnimancerState) bool
Calls Animancer.AnimancerGraph.GetKey(UnityEngine.AnimationClip) then passes the key to Animancer.AnimancerStateDictionary.TryGet(System.Object,Animancer.AnimancerState@) and returns the result.
TryGet(IHasKey, AnimancerState) bool
Passes the Animancer.IHasKey.Key into Animancer.AnimancerStateDictionary.TryGet(System.Object,Animancer.AnimancerState@) and returns the result.
TryGet(Object, AnimancerState) bool
If a `state` is registered with the `key`, this method outputs it and returns true. Otherwise the `state` is set to null and this method returns false.