25 lines
472 B
C#
25 lines
472 B
C#
using System;
|
|
using DragonLi.Frame;
|
|
using DragonLi.Core;
|
|
using UnityEngine;
|
|
|
|
public class UiToCamera : MonoBehaviour
|
|
{
|
|
[NonSerialized]
|
|
public Transform CameraPos;
|
|
private void Start()
|
|
{
|
|
CameraPos=World.GetMainCamera();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (CameraPos!=null)
|
|
{
|
|
transform.rotation = Quaternion.LookRotation((transform.position - CameraPos.position).ReflectVectorXOZ());
|
|
}
|
|
}
|
|
}
|
|
|
|
|