how to detect horizantal and vertical drag on screen by mouse.?

I have an game object to which I have to rotate right by dragging mouse horizontally from left to right and similarly to rotate left,up and down.Could any one please help me by giving script for these mouse events…!..thanks in advance

If you have standard Input setup in your project, then you can get x-axis by:


And y-axis by using:


Then you can use the output to rotate your object.