how to know which animation is playing unity code example
Example 1: condition when a animation finishes in unity
if(anim.GetCurrentAnimatorStateInfo(0).normalizedTime > 1){
Debug.Log("not playing");
}
else{
Debug.Log("playing");
}
Example 2: unity get currently playing animation
anim.GetCurrentAnimatorClipInfo(0)[0].clip.name
m_Animator = gameObject.GetComponent<Animator>();
m_CurrentClipInfo = this.m_Animator.GetCurrentAnimatorClipInfo(0);
m_CurrentClipLength = m_CurrentClipInfo[0].clip.length;
m_ClipName = m_CurrentClipInfo[0].clip.name;