NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Framework/UI/UIBackStrategy.cs

41 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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");
}
}
}