using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraManager : MonoBehaviour { public Camera mainCamera; public CharacterController character; public ViewType ViewType = ViewType.TwoD; public bool IsSelectedObject; [Header("3D/Walk camera setting")] public Transform target; public float mouseSensitivity = 3f; public float distanceFromTarget = 3f; [Range(1, 30)] public float MaxDistanceToTarget = 20f; [Range(-1, 5)] public float MinDistanceToTarget = 0; protected Vector3 curentRotation; protected Vector3 smoothVelocity = Vector3.zero; [Range(1,20)] public float moveSpeed; public float smoothTime = 0.2f; protected float rotationX; protected float rotationY; [Header("Setting 2D camera")] [Range(5, 15)] public float MaxYCameraPos; [Range(1, 5)] public float MinYCameraPos; [Range(1, 100)] public float speedDrag; protected Vector3 lastCharacterRotate = Vector3.zero; private Vector3 defaultPosition; }