AlicizaX/Client/Packages/com.alicizax.unity.ui/Runtime/UI/Constant/WindowAttribute.cs

58 lines
1.4 KiB
C#
Raw Normal View History

2025-01-24 16:21:00 +08:00
using System;
using UnityEngine;
namespace AlicizaX.UI.Runtime
{
[AttributeUsage(AttributeTargets.Class)]
public class WindowAttribute : Attribute
{
/// <summary>
/// 窗口层级
/// </summary>
public readonly UILayer WindowLayer;
/// <summary>
/// 全屏窗口标记。
/// </summary>
public readonly bool FullScreen;
/// <summary>
/// 延时关闭
/// </summary>
2025-03-04 18:40:14 +08:00
public readonly int CacheTime;
2025-01-24 16:21:00 +08:00
2025-03-04 18:40:14 +08:00
/// <summary>
///
/// </summary>
/// <param name="windowLayer">显示层级</param>
/// <param name="fullScreen">是否全屏遮挡</param>
/// <param name="cacheTime">缓存时间/s -1永久 0不 >=1生效</param>
public WindowAttribute(UILayer windowLayer, bool fullScreen = false, int cacheTime = 0)
2025-01-24 16:21:00 +08:00
{
WindowLayer = windowLayer;
FullScreen = fullScreen;
2025-03-04 18:40:14 +08:00
CacheTime = cacheTime;
2025-01-24 16:21:00 +08:00
}
}
[AttributeUsage(AttributeTargets.Class)]
public class UIResAttribute : Attribute
{
public readonly string ResLocation;
public readonly EUIResLoadType ResLoadType;
public UIResAttribute(string location, EUIResLoadType loadType)
{
ResLocation = location;
ResLoadType = loadType;
}
}
2025-03-04 18:40:14 +08:00
public enum EUIResLoadType:byte
2025-01-24 16:21:00 +08:00
{
Resources,
AssetBundle
}
}