AnimancerLayer.

GetOrCreateState(AnimationClip, bool) Method

Summary

Calls Animancer.AnimancerPlayable.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.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
AnimancerLayer

Syntax

public AnimancerState GetOrCreateState(AnimationClip clip, bool allowSetClip = false)

Parameters

Name Type Description
clip AnimationClip
allowSetClip bool

Return Value

Type Description
AnimancerState