Trigger event when animation clip has played once.

I have an animator and 3 animations ( Mele , Ranged and Idle ). the Idle animation is the default animation. I have 3 bools controlling the animation ( EntityIdle ,EntityAttackingMele, EntityAttackingDistance). If EntityIdle = true the Idle animation loops. If EntityAttackingMele= true I want the Mele animation to play once. and once it has finished I want an event triggered which sets EntityAttackingMele= false and EntityIdle = true (and does some other stuff like health and stats , but thats not revelant to the question ).I have been wrestling with this problem for the past 2 days (and have probably got a coffe overdose now )and have not found a solution. please help !
note : its a 2d animation. not sure if that matters.

Use triggers, or use AnimationEvents.
If you attach a script to the same object as an Animator, your animations can call functions in that script by adding events to the animation. In the animation window if you right click at the top of the window you can add events. They look like little white ticks above the keyframes.