16 lines
364 B
C#
16 lines
364 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class BillboardNameplate : MonoBehaviour
|
||
|
|
{
|
||
|
|
public Camera targetCamera;
|
||
|
|
|
||
|
|
private void LateUpdate()
|
||
|
|
{
|
||
|
|
Camera cam = targetCamera != null ? targetCamera : Camera.main;
|
||
|
|
if (cam == null)
|
||
|
|
return;
|
||
|
|
|
||
|
|
transform.rotation = Quaternion.LookRotation(transform.position - cam.transform.position);
|
||
|
|
}
|
||
|
|
}
|