AnimancerPlayable.

AnimancerPlayable.StateDictionary 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["IEnumerable<AnimancerState>"] Type-.->Interface1["IAnimationClipCollection"] click Interface1 "/animancer-v7-4/api/Animancer/IAnimationClipCollection" Type["AnimancerPlayable.StateDictionary"] class Type type-node

Syntax

public class AnimancerPlayable.StateDictionary : IEnumerable<AnimancerState>, 
    IAnimationClipCollection

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.
EqualityComparer IEqualityComparer<Object>
The System.Collections.Generic.IEqualityComparer`1 used by every new Animancer.AnimancerPlayable.StateDictionary.
static
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.AnimancerPlayable.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
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.AnimancerPlayable.StateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip, AnimationClip, AnimationClip) void
Calls Animancer.AnimancerPlayable.StateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip, AnimationClip, AnimationClip, AnimationClip) void
Calls Animancer.AnimancerPlayable.StateDictionary.GetOrCreate(UnityEngine.AnimationClip,System.Boolean) for each of the specified clips.
CreateIfNew(AnimationClip[]) void
Calls Animancer.AnimancerPlayable.StateDictionary.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.AnimancerPlayable.StateDictionary.Destroy(UnityEngine.AnimationClip) on all states gathered by Animancer.IAnimationClipCollection.GatherAnimationClips(System.Collections.Generic.ICollection{UnityEngine.AnimationClip}).
DestroyAll(IAnimationClipSource) void
Calls Animancer.AnimancerPlayable.StateDictionary.Destroy(UnityEngine.AnimationClip) on all states gathered by UnityEngine.IAnimationClipSource.GetAnimationClips(System.Collections.Generic.List{UnityEngine.AnimationClip}).
DestroyAll(IEnumerable<AnimationClip>) void
Calls Animancer.AnimancerPlayable.StateDictionary.Destroy(UnityEngine.AnimationClip) on each of the `clips`.
DestroyAll(IList<AnimationClip>) void
Calls Animancer.AnimancerPlayable.StateDictionary.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.AnimancerPlayable.GetKey(UnityEngine.AnimationClip) and returns the state which 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 so use with caution.
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 to 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.AnimancerPlayable.GetKey(UnityEngine.AnimationClip) then passes the key to Animancer.AnimancerPlayable.StateDictionary.TryGet(System.Object,Animancer.AnimancerState@) and returns the result.
TryGet(IHasKey, AnimancerState) bool
Passes the Animancer.IHasKey.Key into Animancer.AnimancerPlayable.StateDictionary.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.