can't get the lenght of actual animation when changed by Animator.CrossFade()

So i need to pause something after i change the animation the same time as the lenght of the clip. But, when i change, i can’t retrieve information about the new animation, just the old that was before on the animator.

   private void ChangeAnimationState(int state)
            if(state == currentState) return;
            animator.CrossFade(state, 0, 0);
            var thisIsNull = animator.GetAnimatorTransitionInfo(0);
            var returnsTheLastState = animator.GetCurrentAnimatorStateInfo(0);
            var thisIsNull2 = animator.GetNextAnimatorStateInfo(0);
            var thisIsFalse = animator.IsInTransition(0);
            var returnsTheLastStateName = animator.GetCurrentAnimatorClipInfo(0);
            currentState = state;

This functions change the value on animator with Cross Fade, so i get this vars to see the values. The names are what wich one returns.

So i made this little Dictionary so i can get the actual info. This adjust the problem, but i would love hear why the AnimatorStateInfo get the last animationClip.

Here is the function and variables:

        private Dictionary<int, AnimationClip> hashAnimationClips;
        private Dictionary<string, int> nameHashes;

        private void GetAnimationsDictionaries()
            var animClips = animator.runtimeAnimatorController.animationClips;
            nameHashes = new Dictionary<string, int>();
            hashAnimationClips = new Dictionary<int, AnimationClip>();
            foreach (var animationClip in animClips)
                var clipName =;
                int hash = Animator.StringToHash(clipName);
                nameHashes.Add(clipName, hash);
                hashAnimationClips.Add(hash, animationClip);