Files
zeling_v2/Assets/_Game/Scripts/UI/IUIManager.cs
2026-05-25 11:54:37 +08:00

24 lines
918 B
C#
Raw Permalink 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;
namespace BaseGames.UI
{
/// <summary>
/// 面板栈管理接口。所有需要操作 UI 面板的组件应依赖此接口而非直接引用
/// <see cref="UIManager"/>,从而保持可测试性和解耦合。
/// </summary>
public interface IUIManager
{
/// <summary>通过枚举 ID 打开已注册面板。</summary>
void OpenPanel(PanelId id);
/// <summary>打开指定 GameObject 面板并压栈已在栈中则忽略O(1) 判断)。</summary>
void OpenPanel(GameObject panel);
/// <summary>关闭栈顶面板并恢复上一层;上一层若实现 <see cref="IFocusable"/> 则自动恢复焦点。</summary>
void CloseTopPanel();
/// <summary>运行时注册或覆盖面板绑定(如场景加载后动态添加的面板)。</summary>
void RegisterPanel(PanelId id, GameObject root);
}
}