集成 Game Core P0 纵向切片
This commit is contained in:
@@ -510,15 +510,10 @@ public sealed class UIPanelAttribute : Attribute
|
|||||||
public string Path { get; }
|
public string Path { get; }
|
||||||
public PanelStrategy? OverrideStrategy { get; }
|
public PanelStrategy? OverrideStrategy { get; }
|
||||||
|
|
||||||
public UIPanelAttribute(
|
public UIPanelAttribute(string layer);
|
||||||
string layer,
|
public UIPanelAttribute(string layer, string path);
|
||||||
string path = null,
|
public UIPanelAttribute(string layer, PanelStrategy overrideStrategy);
|
||||||
PanelStrategy? overrideStrategy = null)
|
public UIPanelAttribute(string layer, string path, PanelStrategy overrideStrategy);
|
||||||
{
|
|
||||||
Layer = layer;
|
|
||||||
Path = path;
|
|
||||||
OverrideStrategy = overrideStrategy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -549,6 +544,7 @@ public abstract class UIPanelBase<TViewModel> : MonoBehaviour
|
|||||||
|
|
||||||
- Panel 必须声明 `UIPanelAttribute`。
|
- Panel 必须声明 `UIPanelAttribute`。
|
||||||
- Attribute 未指定 path 时,按命名约定推导资源路径。
|
- Attribute 未指定 path 时,按命名约定推导资源路径。
|
||||||
|
- C# Attribute 构造参数不支持 `Nullable<T>`,因此 `OverrideStrategy` 属性保持 nullable,但构造函数通过重载表达“未指定”和“指定覆盖策略”。
|
||||||
- 同层级采用 LIFO 栈。
|
- 同层级采用 LIFO 栈。
|
||||||
- 关闭非栈顶 Panel 抛异常。
|
- 关闭非栈顶 Panel 抛异常。
|
||||||
- Destroy 策略关闭时释放资源 handle。
|
- Destroy 策略关闭时释放资源 handle。
|
||||||
|
|||||||
@@ -44,15 +44,10 @@ public sealed class UIPanelAttribute : Attribute
|
|||||||
public string Path { get; }
|
public string Path { get; }
|
||||||
public PanelStrategy? OverrideStrategy { get; }
|
public PanelStrategy? OverrideStrategy { get; }
|
||||||
|
|
||||||
public UIPanelAttribute(
|
public UIPanelAttribute(string layer);
|
||||||
string layer,
|
public UIPanelAttribute(string layer, string path);
|
||||||
string path = null,
|
public UIPanelAttribute(string layer, PanelStrategy overrideStrategy);
|
||||||
PanelStrategy? overrideStrategy = null)
|
public UIPanelAttribute(string layer, string path, PanelStrategy overrideStrategy);
|
||||||
{
|
|
||||||
Layer = layer;
|
|
||||||
Path = path;
|
|
||||||
OverrideStrategy = overrideStrategy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -61,6 +56,7 @@ public sealed class UIPanelAttribute : Attribute
|
|||||||
- `Layer` 必填。
|
- `Layer` 必填。
|
||||||
- `Path` 可选;未填时按命名约定推导。
|
- `Path` 可选;未填时按命名约定推导。
|
||||||
- `OverrideStrategy` 可选,优先于层级默认策略。
|
- `OverrideStrategy` 可选,优先于层级默认策略。
|
||||||
|
- 说明:C# Attribute 构造参数不支持 `Nullable<T>`,因此 `OverrideStrategy` 属性保持 nullable,但通过重载表达“未指定”和“指定覆盖策略”。
|
||||||
|
|
||||||
## Panel 基类
|
## Panel 基类
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user