GFramework/GFramework.Game.Abstractions/enums/SceneTransitionPhases.cs
GeWuYou 53c2ee4ef3 feat(router): 添加场景和UI路由的Around中间件支持
- 在SceneRouterBase和UiRouterBase中集成管道执行Around处理器
- 实现场景过渡管道SceneTransitionPipeline的Around处理器注册和执行功能
- 实现UI过渡管道UiTransitionPipeline的Around处理器注册和执行功能
- 添加ISceneAroundTransitionHandler和IUiAroundTransitionHandler接口定义
- 扩展SceneTransitionPhases和UITransitionPhases枚举支持Around阶段
- 实现Around处理器的优先级排序和中间件链构建机制
- 添加Around处理器的超时控制和异常处理机制
2026-02-15 16:59:09 +08:00

49 lines
1.9 KiB
C#

// Copyright (c) 2026 GeWuYou
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace GFramework.Game.Abstractions.enums;
/// <summary>
/// 场景过渡阶段枚举,定义了场景切换过程中的不同执行阶段。
/// 使用 Flags 特性支持组合多个阶段。
/// </summary>
[Flags]
public enum SceneTransitionPhases
{
/// <summary>
/// 场景切换前阶段(阻塞执行)。
/// 用于执行需要在场景切换前完成的操作,如显示加载动画、弹出确认对话框等。
/// 此阶段的处理器会阻塞场景切换流程,直到所有处理器执行完成。
/// </summary>
BeforeChange = 1,
/// <summary>
/// 场景切换后阶段(非阻塞执行)。
/// 用于执行场景切换后的后续操作,如播放音效、记录日志、发送统计数据等。
/// 此阶段的处理器异步执行,不会阻塞场景切换流程。
/// </summary>
AfterChange = 2,
/// <summary>
/// 中间件阶段(阻塞执行)。
/// 用于包裹整个场景切换过程的逻辑,如性能监控、事务管理、权限验证等。
/// Around 处理器在变更前后都会执行,可以控制是否继续执行变更。
/// </summary>
Around = 4,
/// <summary>
/// 所有阶段的组合标志。
/// 表示处理器适用于场景切换的所有阶段。
/// </summary>
All = BeforeChange | AfterChange | Around
}