Class AnimationUtilities
Misc utility functions for animation related tasks
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class AnimationUtilities
Methods
| Edit this page View SourceGetCurrentAnimationTime(Animator)
Gets the duration of the currently playing animation state
Declaration
public static float GetCurrentAnimationTime(this Animator animator)
Parameters
Type | Name | Description |
---|---|---|
Animator | animator | The animator to check under |
Returns
Type | Description |
---|---|
float | Returns the duration of the currently playing animation state |
PlayAnimation(Animator, string)
Plays an animation state
Declaration
public static void PlayAnimation(this Animator animator, string animationStateName)
Parameters
Type | Name | Description |
---|---|---|
Animator | animator | The animator to play the state on |
string | animationStateName | The state to play |
PlayAnimationTillDone(Animator, string)
Plays an animation state and waits until it is finished
Declaration
public static IEnumerator PlayAnimationTillDone(this Animator animator, string animationStateName)
Parameters
Type | Name | Description |
---|---|---|
Animator | animator | The animator to play the state on |
string | animationStateName | The state to play |
Returns
Type | Description |
---|---|
IEnumerator |