Files
XericUIActionVessel/Runtime/OverrideUI/AvrgValues/XuiAvrgMDGroup.cs
T
lrss3 4e760d59d1 refactor(注册路径): 调用点收进 XericRegistrationPaths,46 个文件只动注册属性行
10-27 那笔把表的根定成 XericLibrary,但 58 处 AddComponentMenu、4 处 CreateAssetMenu
和若干 MenuItem/ContextMenu 还各自写着 "Xeric UI Vessel/…"、"Xeric/XChart/…" 三套
旧字面量;那批转换一直停在工程里没提交。本笔只收这 46 个"除注册属性外没有别的改动"
的文件,路径出处从此只在表里一处。

工作区里另外 3 个文件(XericImage 的角偏移、IVisibility 接口、XericInfiniteVesselBase
的 region/注释)混着功能改动,不在本笔;Editor/OverrideUI/XericImageEditor.cs 与
Runtime/OverrideUI/XericImageDeform.cs 两个未入库新文件也不在。
2026-10-30 12:34:34 +08:00

57 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 XericUI.Core;
namespace XericUI.ReflectionUIGenerator
{
/// <summary>
/// MDVM 编组容器脚本
/// 管理 GroupPath 对应的编组容器,容纳子 UI 组件
///
/// 外部组件挂载后尺寸由父级影响
/// 内部子元素通过锚点系统获得布局
/// 可通过挂载 TMP_Text / Image 等组件实现组标题/背景装饰
/// </summary>
[AddComponentMenu(XericRegistrationPaths.UI + "/XuiAvrgMDGroup")]
public class XuiAvrgMDGroup : MonoBehaviour
{
[SerializeField]
[Tooltip("编组路径,对应元数据的 GroupPath")]
private string _groupName;
[SerializeField]
[Tooltip("编组排序值,越小越靠前")]
private int _groupOrder;
/// <summary>内容挂载点 — 子 UI 组件或子组应放入此 Transform</summary>
public Transform contentRoot;
/// <summary>父编组(为 null 表示根组,直接挂在 Manager 下)</summary>
public XuiAvrgMDGroup ParentGroup { get; private set; }
/// <summary>编组路径对应的组名</summary>
public string GroupName => _groupName;
/// <summary>编组排序值</summary>
public int GroupOrder => _groupOrder;
/// <summary>上下文层级深度(如 "Stats/Speed" → depth=2)</summary>
public int ContextDepth { get; private set; }
/// <summary>
/// 初始化编组容器
/// </summary>
public void Initialize(string groupPath, int order, XuiAvrgMDGroup parent = null)
{
_groupName = groupPath;
_groupOrder = order;
ParentGroup = parent;
ContextDepth = string.IsNullOrEmpty(groupPath) ? 0 : groupPath.Split('/').Length;
gameObject.name = $"Group [{groupPath}]";
if (contentRoot == null)
contentRoot = transform;
}
}
}