LookAtCamera.cs 313 B

12345678910111213141516
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace DTYJ
  5. {
  6. public class LookAtCamera : MonoBehaviour
  7. {
  8. private void Update()
  9. {
  10. if (Camera.main != null)
  11. transform.LookAt(Camera.main.transform, Vector3.up);
  12. }
  13. }
  14. }