How to set/reset a parameter at the end of animation?

I am transitioning between 2 animations using a parameter.

Animation A ----------set parametere to 1----------> Animation B

At the end of animation B, I want to go back to Animation A, and reset the parameter back to 0.

How would I do that?

click on your fbx file and you found animation tab in inspector

select particular animation and than below that you found option event you can add event there and select which method you want to call from particular script

I know this is an old question, but I was looking for a similar thing tonight. Of course there are various ways to accomplish this, but I wanted something simple and elegant. In the end I settled for this temporarily at least:

void Update ()
{
        if (usingAbility)  
        {
            usingAbility = false;
            ResetAbilityState();  // The parameter is reset on the following frame
        }
        if (Input.GetAxis("Fire") > 0f)
        {
            usingAbility = true;
            DoAbility(true, 1);  //This function sets the animation parameter to 1.
        }
}

I used a bool which is checked on the next frame and if true (i.e. the animation was triggered) the integer parameter is switched back to a default value. The animation will still play to completion but won’t loop afterward.

I may arrive here almost 4 years later, but I just found in some situations you can refocus this case by using Triggers instead of Booleans. A trigger is called only once, so in case you want to use a parameter to reset the boolean which called the animation state, you can control it in a really clean way.