30 lines
702 B
C#
30 lines
702 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Billboard : MonoBehaviour
|
|
{
|
|
private Transform cameraTransform;
|
|
|
|
private void Start()
|
|
{
|
|
StartCoroutine(LateStart());
|
|
}
|
|
|
|
IEnumerator LateStart()
|
|
{
|
|
yield return new WaitForSeconds(0.1f);
|
|
cameraTransform = PlayerManager.GetInstance()._cameraMovement.transform;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void LateUpdate()
|
|
{
|
|
if (cameraTransform != null)
|
|
{
|
|
transform.LookAt(transform.position + cameraTransform.rotation
|
|
* Vector3.forward, cameraTransform.transform.rotation * Vector3.up);
|
|
}
|
|
}
|
|
}
|