Angle Hell!

I’m trying to ‘simply’ rotate a camera in x degree steps on a function. I have managed to to this fine for a clockwise direction (with a hack when it gets to 360 degrees) but my anticlockwise direction is all screwed up. It strikes me that there must be a much easier way of doing this simple task? Anyone got any ideas? ie…is there any way I can have angle increment beyond 360 degrees perhaps?

Thanks

function rotateClockwiseToPosition(degrees : int )
{

	var getInitialRotation : int;
	getInitialRotation=myPivot.transform.eulerAngles.y;
	

		while (myPivot.transform.eulerAngles.y<((getInitialRotation+degrees)))
			{
				//switch 360  to 0 if moving clcokwise
				if(myPivot.transform.eulerAngles.y<50&getInitialRotation<360&getInitialRotation>200)
					{

						myPivot.transform.eulerAngles.y=0;
						getInitialRotation=0;
						break;
					}
	
			cameraAutoMoving=true;
			myPivot.transform.Rotate(Vector3(0,1,0),cameraSpeed*Time.deltaTime);
			yield;
			}

}

function rotateAntiClockwiseToPosition(degrees : int )
{

	var getInitialRotation : int;
	getInitialRotation=myPivot.transform.eulerAngles.y;
	
	if (getInitialRotation==0)
		{
			getInitialRotation=360;
			myPivot.transform.eulerAngles.y=getInitialRotation;
		}
	

		while (myPivot.transform.eulerAngles.y>((getInitialRotation-degrees)))
			{
				//switch 360  to 0 if moving clcokwise
				if(myPivot.transform.eulerAngles.y>3100&getInitialRotation>0&getInitialRotation<120)
					{

						myPivot.transform.eulerAngles.y=360;
						getInitialRotation=360;
						break;
					}
	
			cameraAutoMoving=true;
			myPivot.transform.Rotate(Vector3(0,1,0),-cameraSpeed*Time.deltaTime);
			yield;
			}

}

SOLVED! Thanks to a better search on angles/rotations I found the following function instead>> Works a treat!!

function RotateObject(myAngle : int) 
{ 
   var oldRotation = myPivot.transform.rotation; 
   myPivot.transform.Rotate(0,myAngle,0); 
   var newRotation = myPivot.transform.rotation; 
    
   for (t = 0.0; t <= 1.0; t += Time.deltaTime) 
      { 
            myPivot.transform.rotation = Quaternion.Slerp(oldRotation, newRotation, t); 
            yield; 
      } 
    
   myPivot.transform.rotation = newRotation; // To make it come out at exactly 90 degrees 
          
}