You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
330 B

using UnityEngine;
public static class AnimatorExtension
{
public static bool IsComplete(this Animator animator, int nameHash)
{
var stateInfo = animator.GetCurrentAnimatorStateInfo(0);
if (stateInfo.shortNameHash == nameHash && stateInfo.normalizedTime >= 1.0f) return true;
return false;
}
}