40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using UnityEngine;
|
||
|
||
namespace BaseGames.UI.Theme
|
||
{
|
||
/// <summary>主题角色种类。控制 <see cref="UIThemeApplier"/> 应用何种令牌到目标组件。</summary>
|
||
public enum UIThemeRoleKind
|
||
{
|
||
// Graphic(Image / RawImage / Panel 等)
|
||
Graphic_Primary,
|
||
Graphic_Secondary,
|
||
Graphic_Accent,
|
||
Graphic_Background,
|
||
Graphic_Success,
|
||
Graphic_Warning,
|
||
Graphic_Danger,
|
||
|
||
// TMP_Text
|
||
Text_Primary,
|
||
Text_Secondary,
|
||
Text_Header,
|
||
Text_Disabled,
|
||
|
||
// Button(应用 ColorBlock)
|
||
Button,
|
||
}
|
||
|
||
/// <summary>
|
||
/// 标记组件:告诉 <see cref="UIThemeApplier"/> 当前节点扮演的视觉角色。
|
||
/// </summary>
|
||
[DisallowMultipleComponent]
|
||
public class UIThemeRole : MonoBehaviour
|
||
{
|
||
[SerializeField] private UIThemeRoleKind _kind = UIThemeRoleKind.Text_Primary;
|
||
[SerializeField] private bool _overrideFontSize = false;
|
||
|
||
public UIThemeRoleKind Kind => _kind;
|
||
public bool OverrideFontSize => _overrideFontSize;
|
||
}
|
||
}
|