Hi,this script rotates object on world cordinates (around its axis) so what i want to do is,when i press “button” then it only rotates 180 degrees,not all the time,only 180 degrees and when i press again “button” it rotates back to its position. please help me 
function Update() {
transform.Rotate(Vector3.left , Space.World);
}
Update is called every frame, so yeah, your current script is telling it to keep rotating more every frame. There are two things you could do:
A) Use a coroutine instead of Update, only have it run until you reach the desired angle.
B) Have a variable for what state you are in (StartPosition, Turning, EndPosition, Returning) and have Update do different things depending on that state, and update it appropriately.
In either case, you also need a function for the button to call, a parameter for how fast it rotates, and so forth.
Actually no,i dont wana thank to you,this did not help me at ALLLLLL!!!