Files
zeling_v2/Assets/_Game/Scripts/UI/Settings/SettingsSchemaSO.cs
2026-06-06 09:00:11 +08:00

32 lines
1.0 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 System;
using UnityEngine;
namespace BaseGames.UI.Settings
{
/// <summary>
/// 设置面板的数据驱动表(策划编辑)。
/// 按顺序列出设置项与分节标题;<see cref="DataDrivenSettingsPanel"/> 据此生成对应控件行。
/// 策划可在 Inspector 增删、重排、改标签、加分节,无需改代码或重编译。
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/UI/Settings Schema", fileName = "UI_SettingsSchema")]
public class SettingsSchemaSO : ScriptableObject
{
[Serializable]
public struct Item
{
[Tooltip("勾选则为分节标题行(仅显示 labelKey不绑定控件。")]
public bool isHeader;
[Tooltip("标签本地化 KeyUI 表)。")]
public string labelKey;
[Tooltip("绑定的设置项isHeader 为 true 时忽略)。")]
public SettingKey key;
}
[SerializeField] private Item[] _items;
public Item[] Items => _items;
}
}