83 lines
2.4 KiB
C#
83 lines
2.4 KiB
C#
/********************************************************************
|
|
文件: 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;
|
|
}
|
|
|
|
}
|
|
}
|