21 lines
449 B
C#
Raw Normal View History

2026-05-06 15:07:56 +02:00
using UnityEngine;
namespace DuloGames.UI
{
public class Demo_LookAtCamera : MonoBehaviour
{
[SerializeField] private Camera m_Camera;
protected void Awake()
{
if (this.m_Camera == null) this.m_Camera = Camera.main;
}
void Update()
{
if (this.m_Camera)
transform.rotation = Quaternion.LookRotation(this.m_Camera.transform.forward);
}
}
}