#if ODIN_INSPECTOR && UNITY_EDITOR using Sirenix.OdinInspector; #endif using System; using UnityEngine; using UnityEngine.UI; namespace AlicizaX.UI.Runtime { [DisallowMultipleComponent] #if ODIN_INSPECTOR && UNITY_EDITOR [HideMonoScript] #endif public abstract class UIHolderObjectBase : UnityEngine.MonoBehaviour { [SerializeField] [HideInInspector] private string Location = string.Empty; private GameObject _target; /// /// UI实例资源对象。 /// public GameObject Target => _target ??= gameObject; private RectTransform _rectTransform; /// /// 窗口矩阵位置组件。 /// public RectTransform RectTransform => _rectTransform ??= _target.transform as RectTransform; /// /// 可见性 /// public bool Visible => Target.activeSelf; private void Awake() { _target = gameObject; } } }