using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class LookAtCamera : MonoBehaviour
|
|
{
|
|
private void Awake()
|
|
{
|
|
UpdateRotation();
|
|
}
|
|
|
|
[ContextMenu("Update Rotation")]
|
|
public void UpdateRotation()
|
|
{
|
|
var _cameraObj = Camera.main.gameObject;
|
|
transform.rotation = _cameraObj.transform.rotation;
|
|
transform.Rotate(new Vector3(0, 180, 0));
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
UpdateRotation();
|
|
}
|
|
}
|