Changing angles on a jumping player C# or JS

I am currently working on a 2d platformer which has the basic side movements and jumping. for my character image i am using sprites so at the moment when he jumps he just stays on his idle sprite.

for my jumping i would like my character to change sprites depending on the angle he is moving towards.

e.g. if the gameobjects angle is between > 80 & <100
{
“upwards spite goes here”
}

that would be when you first start jumping and he is going in an upwards angle into the air.

so basically what i need to know is, is there a way to read which rotation his movement is going towards and then putting that into an if statement?

your help would be greatly appreciated!! thankyou for your time!

Assuming you are using Rigidbody2D for your movement, you can take the ASin() of the velocity to get an angle.

var vel = rigidbody2D.velocity;
var angle = Mathf.ATan2(vel.y, vel.x) * Mathf.Rad2Deg;

This angle starts with 0.0 on the right and proceeds counter-clockwise.