Class AnimationProxy
- Namespace
- Ceres.Gameplay.Animations
- Assembly
- Ceres.Gameplay.dll
Animation proxy can blend multi RuntimeAnimatorController and AnimationClip in hierarchy.
public class AnimationProxy : IDisposable
- Inheritance
-
AnimationProxy
- Implements
- Inherited Members
Constructors
AnimationProxy(Animator)
public AnimationProxy(Animator animator)
Parameters
animatorAnimator
Fields
DefaultLayerIndex
Proxy default animation layer index
public const int DefaultLayerIndex = 0
Field Value
LayerContexts
public readonly Dictionary<LayerHandle, AnimationProxy.LayerContext> LayerContexts
Field Value
Properties
Animator
Get bound Animator
public Animator Animator { get; }
Property Value
ClearAnimatorControllerOnStart
Should proxy clear RuntimeAnimatorController of Animator when completely blend in which can prevent animation artifacts. Set RestoreAnimatorControllerOnStop to true to automatically restore it after stopping
public bool ClearAnimatorControllerOnStart { get; set; }
Property Value
Graph
Get playing UnityEngine.Playables.PlayableGraph
protected PlayableGraph Graph { get; }
Property Value
- PlayableGraph
IsBlendIn
Is proxy blend out
protected bool IsBlendIn { get; }
Property Value
IsBlendOut
Is proxy blendout
protected bool IsBlendOut { get; }
Property Value
IsPlaying
Is proxy playing
public bool IsPlaying { get; }
Property Value
RestoreAnimatorControllerOnStop
Should proxy restore RuntimeAnimatorController after stopping
public bool RestoreAnimatorControllerOnStop { get; set; }
Property Value
RootMontage
Get root montage node
protected AnimationProxy.AnimationMontageNode RootMontage { get; }
Property Value
SourceController
Cached RuntimeAnimatorController of Animator
public RuntimeAnimatorController SourceController { get; }
Property Value
Methods
AddNotifier(AnimationNotifier, LayerHandle)
public void AddNotifier(AnimationNotifier animationNotifier, LayerHandle layerHandle = default)
Parameters
animationNotifierAnimationNotifierlayerHandleLayerHandle
BlendAnimationClipInternal(AnimationClip, float, LayerHandle)
Load animation clip to the graph in blend mode
protected void BlendAnimationClipInternal(AnimationClip animationClip, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animationClipAnimationClipblendInDurationfloatlayerHandleLayerHandle
BlendAnimatorInternal(RuntimeAnimatorController, float, LayerHandle)
Load animator to the graph in blend mode
protected void BlendAnimatorInternal(RuntimeAnimatorController animatorController, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animatorControllerRuntimeAnimatorControllerblendInDurationfloatlayerHandleLayerHandle
CreateLayer(ref LayerHandle, LayerDescriptor)
Get or create a new montage layer
public void CreateLayer(ref LayerHandle layerHandle, LayerDescriptor layerDescriptor)
Parameters
layerHandleLayerHandlelayerDescriptorLayerDescriptor
CreateLayer(ref LayerHandle, string, uint, bool, AvatarMask)
Get or create a new montage layer
public void CreateLayer(ref LayerHandle layerHandle, string layerName, uint layerIndex = 0, bool additive = false, AvatarMask avatarMask = null)
Parameters
layerHandleLayerHandlelayerNamestringlayerIndexuintadditiveboolavatarMaskAvatarMask
CreateSequenceBuilder()
Create an AnimationProxy.AnimationSequenceBuilder from this proxy
public AnimationProxy.AnimationSequenceBuilder CreateSequenceBuilder()
Returns
Dispose()
Release animation proxy
public virtual void Dispose()
Flow_AddAnimationNotifier(int, float, LayerHandle, EventDelegate)
[ExecutableFunction]
public AnimationNotifier Flow_AddAnimationNotifier(int layer, float normalizedTime = -1, LayerHandle layerHandle = default, EventDelegate onNotify = null)
Parameters
layerintnormalizedTimefloatlayerHandleLayerHandleonNotifyEventDelegate
Returns
Flow_CreateMontageLayer(string, uint, bool, AvatarMask)
[ExecutableFunction]
public LayerHandle Flow_CreateMontageLayer(string layerName, uint layerIndex = 0, bool additive = false, AvatarMask avatarMask = null)
Parameters
layerNamestringlayerIndexuintadditiveboolavatarMaskAvatarMask
Returns
Flow_PlayAnimation(AnimationClip, int, float, float)
[ExecutableFunction]
public void Flow_PlayAnimation(AnimationClip animationClip, int loopCount = 1, float blendInTime = 0.25, float blendOutTime = 0.25)
Parameters
animationClipAnimationCliploopCountintblendInTimefloatblendOutTimefloat
Flow_PlayAnimationWithCompleteEvent(AnimationClip, int, float, float, EventDelegate)
[ExecutableFunction]
public void Flow_PlayAnimationWithCompleteEvent(AnimationClip animationClip, int loopCount = 1, float blendInTime = 0.25, float blendOutTime = 0.25, EventDelegate onComplete = null)
Parameters
animationClipAnimationCliploopCountintblendInTimefloatblendOutTimefloatonCompleteEventDelegate
Flow_RemoveAnimationNotifier(AnimationNotifier, LayerHandle)
[ExecutableFunction]
public void Flow_RemoveAnimationNotifier(AnimationNotifier notifier, LayerHandle layerHandle = default)
Parameters
notifierAnimationNotifierlayerHandleLayerHandle
Flow_StopAllAnimation()
[ExecutableFunction]
public void Flow_StopAllAnimation()
Flow_StopAnimation(AnimationClip)
[ExecutableFunction]
public void Flow_StopAnimation(AnimationClip animationClip)
Parameters
animationClipAnimationClip
GetAllLayerContexts()
public AnimationProxy.LayerContext[] GetAllLayerContexts()
Returns
GetAnimationClipInstanceProxy(LayerHandle)
Get animation clip instance proxy if leaf montage use AnimationClip
[ExecutableFunction]
public AnimationProxy.AnimationClipInstanceProxy GetAnimationClipInstanceProxy(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetAnimatorControllerInstanceProxy(LayerHandle)
Get animator controller instance proxy if leaf montage use RuntimeAnimatorController
[ExecutableFunction]
public AnimationProxy.AnimatorControllerInstanceProxy GetAnimatorControllerInstanceProxy(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetEventHandler()
public AnimationProxy.AnimationEventHandler GetEventHandler()
Returns
GetLayerContext(LayerHandle)
public AnimationProxy.LayerContext GetLayerContext(LayerHandle handle)
Parameters
handleLayerHandle
Returns
GetLayerIndex(LayerHandle)
public int GetLayerIndex(LayerHandle layerHandle)
Parameters
layerHandleLayerHandle
Returns
GetLeafAnimationDuration(LayerHandle, int)
Get proxy leaf animator controller current state or animation clip duration
[ExecutableFunction]
public float GetLeafAnimationDuration(LayerHandle layerHandle = default, int innerLayerIndex = 0)
Parameters
layerHandleLayerHandleProxy layer
innerLayerIndexintAnimator layer if leaf montage use animator controller
Returns
GetLeafAnimationName(LayerHandle)
Get proxy leaf animator controller name or animation clip name
[ExecutableFunction]
public string GetLeafAnimationName(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetLeafAnimationNormalizedTime(LayerHandle, int)
Get proxy leaf animator controller current state or animation clip normalized time
[ExecutableFunction]
public float GetLeafAnimationNormalizedTime(LayerHandle layerHandle = default, int innerLayerIndex = 0)
Parameters
layerHandleLayerHandleProxy layer
innerLayerIndexintAnimator layer if leaf montage use animator controller
Returns
GetLeafMontage(LayerHandle)
Get leaf montage node
public AnimationProxy.AnimationMontageNode GetLeafMontage(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetLeafMontageRef(LayerHandle)
Get ref leaf montage node
protected ref AnimationProxy.AnimationMontageNode GetLeafMontageRef(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetLeafPlayable(LayerHandle)
Get leaf Playable
public Playable GetLeafPlayable(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
GetLeafPlayableRef(LayerHandle)
Get ref leaf Playable
protected ref Playable GetLeafPlayableRef(LayerHandle layerHandle = default)
Parameters
layerHandleLayerHandle
Returns
Invoke_Flow_AddAnimationNotifier(AnimationProxy, int, float, LayerHandle, EventDelegate)
[ExecutableFunction]
public static AnimationNotifier Invoke_Flow_AddAnimationNotifier(AnimationProxy value, int value, float value, LayerHandle value, EventDelegate value)
Parameters
valueAnimationProxyvalueintvaluefloatvalueLayerHandlevalueEventDelegate
Returns
Invoke_Flow_CreateMontageLayer(AnimationProxy, string, uint, bool, AvatarMask)
[ExecutableFunction]
public static LayerHandle Invoke_Flow_CreateMontageLayer(AnimationProxy value, string value, uint value, bool value, AvatarMask value)
Parameters
valueAnimationProxyvaluestringvalueuintvalueboolvalueAvatarMask
Returns
Invoke_Flow_PlayAnimation(AnimationProxy, AnimationClip, int, float, float)
[ExecutableFunction]
public static void Invoke_Flow_PlayAnimation(AnimationProxy value, AnimationClip value, int value, float value, float value)
Parameters
valueAnimationProxyvalueAnimationClipvalueintvaluefloatvaluefloat
Invoke_Flow_PlayAnimationWithCompleteEvent(AnimationProxy, AnimationClip, int, float, float, EventDelegate)
[ExecutableFunction]
public static void Invoke_Flow_PlayAnimationWithCompleteEvent(AnimationProxy value, AnimationClip value, int value, float value, float value, EventDelegate value)
Parameters
valueAnimationProxyvalueAnimationClipvalueintvaluefloatvaluefloatvalueEventDelegate
Invoke_Flow_RemoveAnimationNotifier(AnimationProxy, AnimationNotifier, LayerHandle)
[ExecutableFunction]
public static void Invoke_Flow_RemoveAnimationNotifier(AnimationProxy value, AnimationNotifier value, LayerHandle value)
Parameters
valueAnimationProxyvalueAnimationNotifiervalueLayerHandle
Invoke_Flow_StopAllAnimation(AnimationProxy)
[ExecutableFunction]
public static void Invoke_Flow_StopAllAnimation(AnimationProxy value)
Parameters
valueAnimationProxy
Invoke_Flow_StopAnimation(AnimationProxy, AnimationClip)
[ExecutableFunction]
public static void Invoke_Flow_StopAnimation(AnimationProxy value, AnimationClip value)
Parameters
valueAnimationProxyvalueAnimationClip
Invoke_GetAnimationClipInstanceProxy(AnimationProxy, LayerHandle)
[ExecutableFunction]
public static AnimationProxy.AnimationClipInstanceProxy Invoke_GetAnimationClipInstanceProxy(AnimationProxy value, LayerHandle value)
Parameters
valueAnimationProxyvalueLayerHandle
Returns
Invoke_GetAnimatorControllerInstanceProxy(AnimationProxy, LayerHandle)
[ExecutableFunction]
public static AnimationProxy.AnimatorControllerInstanceProxy Invoke_GetAnimatorControllerInstanceProxy(AnimationProxy value, LayerHandle value)
Parameters
valueAnimationProxyvalueLayerHandle
Returns
Invoke_GetLeafAnimationDuration(AnimationProxy, LayerHandle, int)
[ExecutableFunction]
public static float Invoke_GetLeafAnimationDuration(AnimationProxy value, LayerHandle value, int value)
Parameters
valueAnimationProxyvalueLayerHandlevalueint
Returns
Invoke_GetLeafAnimationName(AnimationProxy, LayerHandle)
[ExecutableFunction]
public static string Invoke_GetLeafAnimationName(AnimationProxy value, LayerHandle value)
Parameters
valueAnimationProxyvalueLayerHandle
Returns
Invoke_GetLeafAnimationNormalizedTime(AnimationProxy, LayerHandle, int)
[ExecutableFunction]
public static float Invoke_GetLeafAnimationNormalizedTime(AnimationProxy value, LayerHandle value, int value)
Parameters
valueAnimationProxyvalueLayerHandlevalueint
Returns
Invoke_IsFullBodyOverride(AnimationProxy)
[ExecutableFunction]
public static bool Invoke_IsFullBodyOverride(AnimationProxy value)
Parameters
valueAnimationProxy
Returns
Invoke_LoadAnimationClip(AnimationProxy, AnimationClip, float, LayerHandle)
[ExecutableFunction]
public static void Invoke_LoadAnimationClip(AnimationProxy value, AnimationClip value, float value, LayerHandle value)
Parameters
valueAnimationProxyvalueAnimationClipvaluefloatvalueLayerHandle
Invoke_LoadAnimator(AnimationProxy, RuntimeAnimatorController, float, LayerHandle)
[ExecutableFunction]
public static void Invoke_LoadAnimator(AnimationProxy value, RuntimeAnimatorController value, float value, LayerHandle value)
Parameters
valueAnimationProxyvalueRuntimeAnimatorControllervaluefloatvalueLayerHandle
Invoke_Stop(AnimationProxy, float, bool)
[ExecutableFunction]
public static void Invoke_Stop(AnimationProxy value, float value, bool value)
Parameters
valueAnimationProxyvaluefloatvaluebool
IsFullBodyOverride()
Whether proxy override full body animation
[ExecutableFunction]
public bool IsFullBodyOverride()
Returns
LoadAnimationClip(AnimationClip, float, LayerHandle)
Start playing animation from new AnimationClip and blend in if blendInDuration greater than 0
[ExecutableFunction]
public void LoadAnimationClip(AnimationClip animationClip, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animationClipAnimationClipblendInDurationfloatlayerHandleLayerHandle
LoadAnimationClip_Implementation(AnimationClip, float, LayerHandle)
Load animation clip to the graph
protected virtual void LoadAnimationClip_Implementation(AnimationClip animationClip, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animationClipAnimationClipblendInDurationfloatlayerHandleLayerHandle
LoadAnimator(RuntimeAnimatorController, float, LayerHandle)
Start playing animation from new RuntimeAnimatorController and blend in if blendInDuration greater than 0
[ExecutableFunction]
public void LoadAnimator(RuntimeAnimatorController animatorController, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animatorControllerRuntimeAnimatorControllerblendInDurationfloatlayerHandleLayerHandle
LoadAnimator_Implementation(RuntimeAnimatorController, float, LayerHandle)
Load animator to the graph
protected virtual void LoadAnimator_Implementation(RuntimeAnimatorController animatorController, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animatorControllerRuntimeAnimatorControllerblendInDurationfloatlayerHandleLayerHandle
PlayAnimationClipInternal(AnimationClip, float, LayerHandle)
Load animation clip to the graph in play mode
protected void PlayAnimationClipInternal(AnimationClip animationClip, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animationClipAnimationClipblendInDurationfloatlayerHandleLayerHandle
PlayAnimatorInternal(RuntimeAnimatorController, float, LayerHandle)
Load animator to the graph in play mode
protected void PlayAnimatorInternal(RuntimeAnimatorController animatorController, float blendInDuration = 0.25, LayerHandle layerHandle = default)
Parameters
animatorControllerRuntimeAnimatorControllerblendInDurationfloatlayerHandleLayerHandle
PlayInternal(float)
Start play graph and montage
protected void PlayInternal(float blendInDuration)
Parameters
blendInDurationfloat
RegisterNotifyCallback(EventCallback<AnimationNotifyEvent>)
public void RegisterNotifyCallback(EventCallback<AnimationNotifyEvent> callback)
Parameters
callbackEventCallback<AnimationNotifyEvent>
RemoveNotifier(AnimationNotifier, LayerHandle)
public void RemoveNotifier(AnimationNotifier notifier, LayerHandle layerHandle = default)
Parameters
notifierAnimationNotifierlayerHandleLayerHandle
SetInGraph()
Call this function after animation proxy completly blend in
protected virtual void SetInGraph()
SetOutGraph()
Call this function after animation proxy completely blend out
protected virtual void SetOutGraph()
Shrink(AnimationMontageNode, LayerHandle)
Call this function to release not used playables after montage completely blend in
protected virtual void Shrink(AnimationProxy.AnimationMontageNode node, LayerHandle layerHandle)
Parameters
nodeAnimationProxy.AnimationMontageNodelayerHandleLayerHandle
Stop(float, bool)
Stop animation proxy montage and blend out if blendOutDuration greater than 0
[ExecutableFunction]
public void Stop(float blendOutDuration = 0.25, bool immediately = true)
Parameters
StopAllAnimationSequences()
Stop all running animation sequences created by this proxy
public void StopAllAnimationSequences()
UnregisterNotifyCallback(EventCallback<AnimationNotifyEvent>)
public void UnregisterNotifyCallback(EventCallback<AnimationNotifyEvent> callback)
Parameters
callbackEventCallback<AnimationNotifyEvent>