2026-01-12 15:21:21 +08:00
|
|
|
|
using PhxhSDK;
|
2025-12-25 20:26:05 +08:00
|
|
|
|
|
2026-01-12 15:21:21 +08:00
|
|
|
|
namespace Framework
|
2025-12-25 20:26:05 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2026-01-12 15:21:21 +08:00
|
|
|
|
/// 项目特定的 UI 返回键策略初始化
|
|
|
|
|
|
///
|
|
|
|
|
|
/// 说明:
|
|
|
|
|
|
/// - 通用策略(None, CloseSelf, DoNothing)已在 PhxhSDK.UIBackStrategyFactory 中实现
|
|
|
|
|
|
/// - 此文件仅用于注册项目特定的自定义策略
|
|
|
|
|
|
/// - 在 UIManager.Init() 中调用 RegisterProjectStrategies() 进行注册
|
2025-12-25 20:26:05 +08:00
|
|
|
|
/// </summary>
|
2026-01-12 15:21:21 +08:00
|
|
|
|
public static class UIBackStrategyInitializer
|
2025-12-25 20:26:05 +08:00
|
|
|
|
{
|
2026-01-12 15:21:21 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 注册项目特定的返回键策略
|
|
|
|
|
|
/// 需要在 UIManager 初始化时调用
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void RegisterProjectStrategies()
|
2025-12-25 20:26:05 +08:00
|
|
|
|
{
|
2026-01-12 15:21:21 +08:00
|
|
|
|
// 注册"显示退出确认"策略
|
|
|
|
|
|
// 使用项目特定的退出确认窗口名称
|
|
|
|
|
|
UIBackStrategyFactory.RegisterStrategy(
|
|
|
|
|
|
UIBackStrategyType.ShowExitConfirm,
|
|
|
|
|
|
new UIBackStrategy_ShowConfirm(UINameConst.UIBackReturn)
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
DebugUtil.Log("[UIBackStrategy] Project-specific strategies registered");
|
2025-12-25 20:26:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-01-12 15:21:21 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清理项目策略(可选,用于测试或重置)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static void UnregisterProjectStrategies()
|
2025-12-25 20:26:05 +08:00
|
|
|
|
{
|
2026-01-12 15:21:21 +08:00
|
|
|
|
UIBackStrategyFactory.UnregisterStrategy(UIBackStrategyType.ShowExitConfirm);
|
|
|
|
|
|
DebugUtil.Log("[UIBackStrategy] Project-specific strategies unregistered");
|
2025-12-25 20:26:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|