have camera rotate around object

Hi there, I am making a UI selection screen that has a camera that shows the object, I do not need to show the back of the object. I want it to rotate 60 degrees either way. this is the code I have now, I just don’t know how to stop it and initiate it moving the opposite way.

public class CameraRotator : MonoBehaviour

{

public float speed;

void Update()  

{
    transform.Rotate(0, speed * Time.deltaTime, 0);
}

}

public float maxAngle;
public float speed;
float angle = 0;
float sign = 1;

    void Update()
    {

        if (Mathf.Abs(angle) > maxAngle)
        {
            sign *= -1;
            angle = maxAngle * sign * -1;
        }

        angle += speed * sign * Time.deltaTime;
        transform.rotation = Quaternion.Euler(0, angle, 0);
    }

The current accepted answer is fine but thought I’d add another option that is a bit simpler and will have smoother animation as well. This just uses Sin which will return a value between -1 and 1 for a given input, so you can scale the input and output to get varying ranges and frequencies. It has the added benefit of tracking less state and no conditions as well.

public float MaxAngle = 60.0f;
public float Speed = 1.0f;

private float timer = 0;

private void Update()
{
    timer += Time.deltaTime * Speed;
    transform.rotation = Quaternion.Euler(0, Mathf.Sin(timer) * MaxAngle, 0);
}