using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public int Sensitivity;
private float MouseYSet;
void Start () {
MouseYSet = Input.mousePosition.y;
}
void Update () {
transform.localRotation = Quaternion.Euler (Mathf.Clamp (transform.rotation.x, -90, 90), 0, 0);
if (Input.mousePosition.y > MouseYSet)
{
transform.Rotate (new Vector3 (-1, 0, 0) * (Input.mousePosition.y - MouseYSet) * Sensitivity * 10 * Time.deltaTime);
MouseYSet = Input.mousePosition.y;
}
if (Input.mousePosition.y < MouseYSet)
{
transform.Rotate (new Vector3 (-1, 0, 0) * (Input.mousePosition.y - MouseYSet) * Sensitivity * 10 * Time.deltaTime);
MouseYSet = Input.mousePosition.y;
}
}
}