DroneSimulator/Assets/Scripts/Drone/CameraController.cs

23 lines
440 B
C#

using UnityEngine;
public class CameraController : MonoBehaviour
{
private Transform _transform;
private float _maxAngle = 90;
private void Awake()
{
_transform = transform;
}
private void Update()
{
Vector3 rotation = _transform.localRotation.eulerAngles;
rotation.x = _maxAngle * InputController.AngleCamera;
_transform.localRotation = Quaternion.Euler(rotation);
}
}