CameraController.cs 558 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. #pragma warning disable CS0649
  5. namespace EPOOutline.Demo
  6. {
  7. public class CameraController : MonoBehaviour
  8. {
  9. [SerializeField]
  10. private Vector3 shift;
  11. [SerializeField]
  12. private float moveSpeed = 2.0f;
  13. [SerializeField]
  14. private Transform target;
  15. private void Update()
  16. {
  17. transform.position = Vector3.Lerp(transform.position, target.position + shift, Time.deltaTime * moveSpeed);
  18. }
  19. }
  20. }