using UnityEngine;

public class CameraWatch : MonoBehaviour {

    private const float leftBorne = 320;
    private const float rightBorne = 359;

    private static bool turnRight = true;

	void Update() {
        if (transform.eulerAngles.y < leftBorne && !turnRight) {
            turnRight = !turnRight;
            transform.eulerAngles = Vector3.up * leftBorne;
        } else if (transform.eulerAngles.y > rightBorne && turnRight) {
            turnRight = !turnRight;
            transform.eulerAngles = Vector3.up * rightBorne;
        }
        transform.eulerAngles = Vector3.up * (transform.eulerAngles.y + (turnRight ? 1 : -1) * Time.deltaTime);
	}
}