Distance Matching Locomotion : Giving it a shot!

They sets Stop Anim A and Stop Anim B variables in code. Just select required animation for current direction and evaluate it over time. In my solution it looks like this (for one direction):