Check out example codes for "unity animator check if animation is playing". It will help you in understanding the concepts better.

Code Example 1

bool isPlaying(Animator anim, string stateName)
{
    if (anim.GetCurrentAnimatorStateInfo(animLayer).IsName(stateName) &&
            anim.GetCurrentAnimatorStateInfo(animLayer).normalizedTime < 1.0f)
        return true;
    else
        return false;
}

Learn ReactJs, React Native from akashmittal.com