using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// 相机观察器
/// </summary>
public class CameraController : MonoBehaviour
{
// 距离限制目标物体, 可不设置, 即不限制视角拉近拉远的最小最大值
[SerializeField]
Transform limitTarget;
[SerializeField]
float
// 视角旋转敏感度
rotateFactor = 2,
// 视角平移敏感度
translationFactor = 0.1f,
// 视角拉近拉远敏感度
zoomFactor = 5,
// 限制视平面距离目标最小值
limitMinDistance = 1f,
// 限制视平面距离目标最大值
limitMaxDistance = 10f,
// X 角度限制
xLimit = 60,
// 平滑时间
smoothTime = 0.2f;
// 当前旋转值
private Vector3 currentRotati