GeWuYou 65b949b62f perf(scene): 优化路由守卫异步方法性能
- 将 ISceneRouteGuard 中的 Task 返回类型改为 ValueTask
- 将 IUiRouteGuard 中的 Task 返回类型改为 ValueTask
- 移除注释中的多余缩进空格
- 提升异步操作的性能表现
2026-03-17 16:10:24 +08:00

25 lines
829 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.

using GFramework.Game.Abstractions.Routing;
namespace GFramework.Game.Abstractions.UI;
/// <summary>
/// UI路由守卫接口
/// 用于拦截和处理UI路由切换实现业务逻辑解耦
/// </summary>
public interface IUiRouteGuard : IRouteGuard<IUiPageBehavior>
{
/// <summary>
/// 进入UI前的检查
/// </summary>
/// <param name="uiKey">目标UI标识符</param>
/// <param name="param">进入参数</param>
/// <returns>true表示允许进入false表示拦截</returns>
ValueTask<bool> CanEnterAsync(string uiKey, IUiPageEnterParam? param);
/// <summary>
/// 离开UI前的检查
/// </summary>
/// <param name="uiKey">当前UI标识符</param>
/// <returns>true表示允许离开false表示拦截</returns>
ValueTask<bool> CanLeaveAsync(string uiKey);
}