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

20 lines
698 B
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.
namespace BaseGames.UI
{
/// <summary>
/// 可恢复焦点的 UI 面板接口。
///
/// 挂载在面板根 GameObject 上的 MonoBehaviour 实现此接口后,
/// 当 <see cref="IUIManager.CloseTopPanel"/> 将该面板恢复为栈顶时,
/// 会自动调用 <see cref="OnFocusRestored"/>
/// 将 EventSystem 焦点重置到合适控件,保证手柄/键盘导航不丢失。
/// </summary>
public interface IFocusable
{
/// <summary>
/// 面板成为当前栈顶时自动调用。
/// 实现时请调用 <c>EventSystem.current?.SetSelectedGameObject(...)</c>。
/// </summary>
void OnFocusRestored();
}
}