Evade to input direction

Hello. Can you give me ideas how to make my character to evade in input direction BUT my evade animation should change according to current mesh direction? I don’t know how to explain it correctly so I draw an example:
изображение_2022-01-25_225544
I’m using arrows to illustrate direction of camera and mesh. So, if I’ll press A my character will start turning around, but if I’ll press evade button it won’t have time to do it, so it should use backward evade animation; if I’ll press D and evasion button it should use forward evade animation; W - left evade, S - right evade.