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

20 lines
450 B
C#
Raw Normal View History

2023-09-25 02:08:58 +08:00
using System;
using UnityEngine;
namespace UnityTest.ZXL
{
public abstract class Label : MonoBehaviour
{
protected void Update()
{
2023-10-05 13:49:55 +08:00
var currentCamera = CameraManager.Instance().GetCurrentCamera();
if (currentCamera == null)
{
return;
}
var currentTransform = currentCamera.transform;
2023-09-25 02:08:58 +08:00
transform.LookAt(currentTransform);
}
}
}