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