22 lines
612 B
C#
22 lines
612 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
|
|
namespace Beyond
|
|
{
|
|
[RequireComponent(typeof(Renderer))]
|
|
public class Billboard : MonoBehaviour
|
|
{
|
|
void Update()
|
|
{
|
|
if (Camera.main)
|
|
{
|
|
|
|
//Vector3 righ = Vector3.Cross(Camera.main.transform.forward, Vector3.up);
|
|
//transform.rotation = Quaternion.Euler(new Vector3(0f, Camera.main.transform.eulerAngles.y, 0f));
|
|
transform.rotation = Quaternion.LookRotation(-Camera.main.transform.forward, Vector3.up);
|
|
}
|
|
}
|
|
}
|
|
} |