Rotate animation

Hello, how can I be doing a system where if the player rotates to the right or to the left it performs an animation
example

you need the animation to be part of the 3d model.

I have all animation,i need script or reference

what you need next is unity animator and mecanim.