using BeinLab.Util;
using SC.XR.Unity.Module_InputSystem;
using System;
using System.Reflection;
using UnityEngine;
using UnityEngine.UI;
using XRTool.Util;
namespace XRTool.UI
{
///
/// 基本的UI窗口设置
///
public class Dlg : MonoBehaviour
{
///
/// 标准分辨率
///
public static Vector2 normalSize = new Vector2(1920, 1080);
private RectTransform dlgTrans;
private RectTransform uiTrans;
private RectTransform fullUITrans;
private Image dlgBG;
///
/// 是否可拖拽
/// 设置成可拖拽时,窗口不在跟随视角移动而变化
/// 设置成不可拖拽时,移除/失活拖拽组件
///
public bool isDragEnable = false;
///
/// 是否锁定窗口
/// 锁定,代表此物体不在跟随用户视角变化
/// 不锁定,代表此物体自动跟随用户视角
///
public bool isLock = true;
//public bool isBgBox = true;
//public bool isAutoAddCollider = false;
private ManipulationHandler dragComponent;
///
/// 屏幕转屏设置适应
/// 自动代表此组件不做转屏处理
///
[HideInInspector]
public ScreenOrientation screenOrientation = ScreenOrientation.AutoRotation;
public bool isAutoSize = true;
private static Canvas rootCanvas;
private static Vector2 canvasSize = Vector2.zero;
public Canvas DlgCanvas
{
get
{
if (RootCanvas == null)
{
RootCanvas = GetComponentInParent