Animator Check the end of an animation

I have this simple code here… the Var doesn’t switch at the end of the animation… i even set the animtion Loop Off and On still doesnt work

var LandPhase=true;

function Update(){
BodyAnim=TheBody.GetComponent.<Animator>();

 if(!LandPhase){BodyAnim.Play('jump_20_c');LandPhase=true;}¨
 if(LandPhase&&!BodyAnim.GetCurrentAnimatorStateInfo(0).IsName("jump_20_c")){LandPhase=false;}¨
}

And this too…

var LandPhase=true;

function Update(){
BodyAnim=TheBody.GetComponent.<Animator>();

 if(!LandPhase){BodyAnim.Play('jump_20_c');LandPhase=true;}¨
 if(LandPhase&&BodyAnim.GetCurrentAnimatorStateInfo(0).IsName("jump_20_c")){LandPhase=false;}¨
}

Never mind i found the solution

 GetCurrentAnimatorStateInfo(0).normalizedTime > 0.99f

//normalizedTime =  is equal to the animation frame

Thats the script we should use