forked from zxl/LaboratoryProtection
20 lines
340 B
C#
20 lines
340 B
C#
|
using System;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace UnityTest.ZXL
|
||
|
{
|
||
|
public class LookAtCamera : MonoBehaviour
|
||
|
{
|
||
|
private Camera main;
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
main = Camera.current;
|
||
|
}
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
transform.LookAt(Camera.current.transform);
|
||
|
}
|
||
|
}
|
||
|
}
|