Summary
Returns the state registered with the `key` or creates one if it doesn't exist.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- AnimancerLayer
Syntax
public AnimancerState GetOrCreateState(Object key, AnimationClip clip, bool allowSetClip = false)
Remarks
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.
See also: Animancer.AnimancerStateDictionary.GetOrCreate(System.Object,UnityEngine.AnimationClip,System.Boolean)
.
Parameters
Name | Type | Description |
---|---|---|
key | Object | |
clip | AnimationClip | |
allowSetClip | bool |
Return Value
Type | Description |
---|---|
AnimancerState |