集成 Game Core P0 纵向切片

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

View File

@@ -510,15 +510,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);
}
```
@@ -549,6 +544,7 @@ public abstract class UIPanelBase<TViewModel> : MonoBehaviour
- Panel 必须声明 `UIPanelAttribute`
- Attribute 未指定 path 时,按命名约定推导资源路径。
- C# Attribute 构造参数不支持 `Nullable<T>`,因此 `OverrideStrategy` 属性保持 nullable但构造函数通过重载表达“未指定”和“指定覆盖策略”。
- 同层级采用 LIFO 栈。
- 关闭非栈顶 Panel 抛异常。
- Destroy 策略关闭时释放资源 handle。

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 基类