修正 P0 UI Attribute 契约文档

This commit is contained in:
JSD\13999
2026-05-18 12:11:50 +08:00
parent 00a3368df5
commit 06d7b0dc75
2 changed files with 10 additions and 18 deletions

View File

@@ -44,15 +44,10 @@ public sealed class UIPanelAttribute : Attribute
public string Path { get; }
public PanelStrategy? OverrideStrategy { get; }
public UIPanelAttribute(
string layer,
string path = null,
PanelStrategy? overrideStrategy = null)
{
Layer = layer;
Path = path;
OverrideStrategy = overrideStrategy;
}
public UIPanelAttribute(string layer);
public UIPanelAttribute(string layer, string path);
public UIPanelAttribute(string layer, PanelStrategy overrideStrategy);
public UIPanelAttribute(string layer, string path, PanelStrategy overrideStrategy);
}
```
@@ -61,6 +56,7 @@ public sealed class UIPanelAttribute : Attribute
- `Layer` 必填。
- `Path` 可选;未填时按命名约定推导。
- `OverrideStrategy` 可选,优先于层级默认策略。
- 说明C# Attribute 构造参数不支持 `Nullable<T>`,因此 `OverrideStrategy` 属性保持 nullable但通过重载表达“未指定”和“指定覆盖策略”。
## Panel 基类