44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
#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;
|
|
|
|
/// <summary>
|
|
/// UI实例资源对象。
|
|
/// </summary>
|
|
public GameObject Target => _target ??= gameObject;
|
|
|
|
|
|
private RectTransform _rectTransform;
|
|
|
|
/// <summary>
|
|
/// 窗口矩阵位置组件。
|
|
/// </summary>
|
|
public RectTransform RectTransform => _rectTransform ??= _target.transform as RectTransform;
|
|
|
|
/// <summary>
|
|
/// 可见性
|
|
/// </summary>
|
|
public bool Visible => Target.activeSelf;
|
|
|
|
private void Awake()
|
|
{
|
|
_target = gameObject;
|
|
}
|
|
}
|
|
}
|