IndieGame/client/Assets/Ether/Scripts/Module/UI/UIAtrribute/UIElementAttribute.cs

83 lines
2.4 KiB
C#
Raw Permalink Normal View History

2024-10-11 10:12:15 +08:00
/********************************************************************
: UIElementAttribute.cs
:
: 1982614048@qq.com
: 2024/03/29 17:28:19
:
: 2024/04/03 16:01:10
:
*********************************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ether
{
/// <summary>
/// UI元素的特性
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class UIElementAttribute : Attribute
{
/// <summary>
/// 界面层级
/// </summary>
public FrameTier tier = FrameTier.Middle;
/// <summary>
/// 界面类型
/// </summary>
public FrameType frameType = FrameType.Frame;
/// <summary>
/// 界面路径
/// </summary>
public string framePrefabPath;
/// <summary>
/// 界面关闭时不销毁界面
/// </summary>
public bool isDontCloseDestroy;
public UIElementAttribute(FrameTier tier)
{
this.tier = tier;
}
public UIElementAttribute(FrameType frameType)
{
this.frameType = frameType;
}
public UIElementAttribute(string framePrefabPath)
{
this.framePrefabPath = framePrefabPath;
}
public UIElementAttribute(bool isDontCloseDestroy)
{
this.isDontCloseDestroy = isDontCloseDestroy;
}
public UIElementAttribute(FrameTier tier = FrameTier.Middle, FrameType frameType = FrameType.Frame)
{
this.tier = tier;
this.frameType = frameType;
}
public UIElementAttribute(FrameTier tier = FrameTier.Middle, FrameType frameType = FrameType.Frame, string framePrefabPath = "")
{
this.tier = tier;
this.frameType = frameType;
this.framePrefabPath = framePrefabPath;
}
public UIElementAttribute(FrameTier tier = FrameTier.Middle, FrameType frameType = FrameType.Frame, string framePrefabPath = "", bool isDontCloseDestroy = false)
{
this.tier = tier;
this.frameType = frameType;
this.framePrefabPath = framePrefabPath;
this.isDontCloseDestroy = isDontCloseDestroy;
}
}
}