Files
zeling_v2/Assets/_Game/Scripts/UI/Theme/UIThemeSO.cs
2026-05-25 13:21:41 +08:00

47 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
using TMPro;
namespace BaseGames.UI.Theme
{
/// <summary>
/// 全局 UI 主题资产(架构 10_UIModule §1 视觉风格统一)。
///
/// 设计动机:避免每个 Prefab 各自硬编码颜色 / 字体,统一替换或本地化主题成本极低。
/// 通过 <see cref="UIThemeApplier"/> 在运行时拉取并应用到子节点。
///
/// 资产路径建议Assets/Data/UI/Themes/UI_Theme_Default.asset
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/UI/Theme")]
public class UIThemeSO : ScriptableObject
{
[Header("Palette")]
public Color Primary = new Color(0.10f, 0.55f, 0.95f);
public Color Secondary = new Color(0.20f, 0.20f, 0.25f);
public Color Accent = new Color(1.00f, 0.78f, 0.20f);
public Color Background = new Color(0.06f, 0.07f, 0.10f);
public Color TextPrimary = Color.white;
public Color TextSecondary = new Color(0.75f, 0.78f, 0.82f);
public Color TextDisabled = new Color(0.40f, 0.42f, 0.45f);
public Color Success = new Color(0.30f, 0.85f, 0.45f);
public Color Warning = new Color(0.95f, 0.70f, 0.10f);
public Color Danger = new Color(0.95f, 0.30f, 0.30f);
[Header("Typography")]
public TMP_FontAsset HeaderFont;
public TMP_FontAsset BodyFont;
[Min(8)] public float HeaderFontSize = 36f;
[Min(8)] public float BodyFontSize = 20f;
[Min(8)] public float SmallFontSize = 14f;
[Header("Button States")]
public Color ButtonNormal = new Color(0.10f, 0.55f, 0.95f);
public Color ButtonHighlighted = new Color(0.20f, 0.65f, 1.00f);
public Color ButtonPressed = new Color(0.05f, 0.40f, 0.80f);
public Color ButtonDisabled = new Color(0.30f, 0.30f, 0.32f);
[Header("Audio (可选)")]
public AudioClip ClickSound;
public AudioClip HoverSound;
}
}