about mouse control an object

Hello I'm new to Unity3d

please help me how to script to control an gameobject by mouse , just like this:

when right click and drag ,the object rotates

and when middle click and drag , the object moves

when scroll , the object scales

Many thanks !!

i don't have the time to write the whole code but you should have something like this in Update

if (Input.GetMouseButtonDown (button)) //button should be 0 or 1 or 2
{
var r = camera.ScreenPointToRay (Input.mousePosition);
var h = Physics.RaycastAll (r);
//then check if the object that you want is under the mouse and the button that you want
//is pressed do rotation movement or scale
if (h.collider.gameobject == this.gameobject)
{
//if the gameobject is this gameobject that the script is attached too then do rot/mov/scale
}
}

i added more lines but keep in mind that this code is not optimized and allocate memory in Update. you should not cast a ray in all objects that you want to check. you should cast it just one time in a manager object and send a message to the object that mouse is on it and then if that object has the message's method to execute, it will do what you want.