UI相关优化补充
This commit is contained in:
39
Assets/_Game/Scripts/UI/Theme/UIThemeRole.cs
Normal file
39
Assets/_Game/Scripts/UI/Theme/UIThemeRole.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user