using UnityEngine;
namespace Rokid.UXR.Utility
{
[ExecuteAlways]
public class UIOverlay : MonoBehaviour
{
///
/// panel distance
///
[SerializeField]
private float panelDistance = 10;
///
/// screen width
///
private float width = 1920;
///
/// screen heigh
///
private float height = 1200;
private Canvas canvas;
private FollowCamera followCamera;
private RectTransform rectTransform;
private float prePanelDistance;
private void Start()
{
SetFollowCamera();
SetCanvasParam();
SetRectParam();
}
private void SetFollowCamera()
{
followCamera = GetComponent();
if (followCamera == null)
{
followCamera = gameObject.AddComponent();
}
followCamera.offsetPosition = new Vector3(0, 0, panelDistance);
}
private void SetCanvasParam()
{
canvas = GetComponent