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
349 B
11 lines
349 B
using UnityEngine;
|
|
|
|
public static class AnimatorExtension
|
|
{
|
|
public static bool IsComplete(this Animator animator, int nameHash)
|
|
{
|
|
var stateInfo = animator.GetCurrentAnimatorStateInfo(0);
|
|
if (!stateInfo.loop && stateInfo.shortNameHash == nameHash && stateInfo.normalizedTime >= 1.0f) return true;
|
|
return false;
|
|
}
|
|
}
|