LaboratoryProtection/Assets/UnityTest/ZXL/Scripts/UI/LookAtCamera.cs

20 lines
340 B
C#
Raw Normal View History

2023-09-25 02:08:58 +08:00
using System;
using UnityEngine;
namespace UnityTest.ZXL
{
public class LookAtCamera : MonoBehaviour
{
private Camera main;
private void Start()
{
main = Camera.current;
}
private void Update()
{
transform.LookAt(Camera.current.transform);
}
}
}