using UnityEngine;
using System.Collections;

public class TangageMenu : MonoBehaviour
{
	public int sens= 1;

	// Use this for initialization
	void Start () 
	{

	}
	
	// Update is called once per frame
	void Update () 
	{
		transform.Rotate(0, 0, sens * Time.deltaTime);

		float zAngle = transform.localRotation.eulerAngles.z;
		
		if (zAngle > 180.0f) zAngle -= 360.0f;
			
		if (zAngle > 5.0f) 
		{
			sens = -1;
		}
		if (zAngle < -5.0f) 
		{
			sens = 1;
		}
	}
}