19 lines
383 B
C#
19 lines
383 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class CanvasToView : MonoBehaviour
|
|
{
|
|
Camera mainCam;
|
|
Canvas canvas;
|
|
void Awake()
|
|
{
|
|
mainCam = Camera.main;
|
|
canvas = GetComponent<Canvas>();
|
|
}
|
|
private void Update()
|
|
{
|
|
canvas.transform.LookAt(mainCam.transform.position);
|
|
}
|
|
}
|