Problem with mouse look script.

Hello I need to create the mouse look script that will make the character look only in 180 degrees in front of him and won’t allow him to look back. Here is the code I came up with after looking through couple of tutorials. Problem I have is that it doesn’t actually rotate left to right or right to left. Only spins vertically. If someone could tell me what’s wrong with that code that would be highly appreciated.

	public enum RotationAxis {MouseX = 0, MouseY = 1}
	
		var RotationAxisRotationXY = RotationAxis.MouseX || RotationAxis.MouseY;
		
		//X AXIS
		
		var sensitivityX : float = 400f;
		
		var minimumX : float = -180f;
		var maximumX : float = 180f;
		
		var RotationX : float = 0f;
		
		var OriginalRotation : Quaternion;
		
		//Y AXIS
		
		var RotationY : float = 0f;
		
		var minimumY : float = -25f;
		var maximumY : float = 25f;
		
		var sensitivityY : float = 400f;



function Update () {



	if(RotationAxisRotationXY == RotationAxis.MouseX)
	{
	
	RotationX += Input.GetAxis("Mouse X") * sensitivityX * Time.deltaTime;
	
		OriginalRotation = XQuaternion = Quaternion.AngleAxis (RotationX, Vector3.up);
		
		transform.localRotation = OriginalRotation * XQuaternion;
	}
	
	if(RotationAxisRotationXY == RotationAxis.MouseY)
	{
	
	RotationY -= Input.GetAxis("Mouse Y") * sensitivityY * Time.deltaTime;
	
		OriginalRotation = YQuaternion = Quaternion.AngleAxis (RotationY, Vector3.right);
		
		transform.localRotation = OriginalRotation * YQuaternion;
	
	}



}

maybe rotationaxisrotationXY is always mouseY?