UI系统组件
This commit is contained in:
31
Assets/_Game/Scripts/UI/Settings/SettingsSchemaSO.cs
Normal file
31
Assets/_Game/Scripts/UI/Settings/SettingsSchemaSO.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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("标签本地化 Key(UI 表)。")]
|
||||
public string labelKey;
|
||||
|
||||
[Tooltip("绑定的设置项(isHeader 为 true 时忽略)。")]
|
||||
public SettingKey key;
|
||||
}
|
||||
|
||||
[SerializeField] private Item[] _items;
|
||||
|
||||
public Item[] Items => _items;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user