void Update()
{
if (GameObject.FindWithTag("Player") && !Screen.lockCursor)
Screen.lockCursor = true;
if (Input.GetMouseButtonDown(2))
{
camSwitch = !camSwitch;
if (camSwitch)
camState = CameraState.Orbit;
else
camState = CameraState.ThirdPerson;
}
}