Files
ft/Client/Assets/Scripts/EventBossFight/Act/EventBossFightActTransition.cs
2026-06-29 21:18:33 +08:00

52 lines
2.2 KiB
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 asap.core;
using cfg;
using game;
using GameCore;
namespace EventBossFight
{
/// <summary>
/// Boss 战 Act 与 <see cref="FishingAct"/> 切换时的转场面板:
/// 使用 <see cref="UnloadActToNextAct"/> 的 <c>TransitionPanel</c>,与 <see cref="EventBossFightInit.LoadingPanel"/> 一致
/// (如亚特兰蒂斯 <c>EventBossFightAtlantisLoadingPanel</c>),请在配置表 LoadingPanel 字段填写对应预制体 key。
/// </summary>
public static class EventBossFightActTransition
{
public const string BossFightActId = nameof(EventBossFightAct);
/// <summary>将 <see cref="UITypes.EventBossFightLoadingPanel"/> 设为当前活动配置的 Loading 预制体,用作 Act 转场。</summary>
public static void ApplyLoadingPanelAsActTransition(EventBossFightInit init)
{
if (init == null || string.IsNullOrEmpty(init.LoadingPanel))
return;
UITypes.EventBossFightLoadingPanel.SetType(init.LoadingPanel);
}
/// <summary>从主界面进入 Boss 战 Act云/转场条目前会先播 LoadingPanel。</summary>
public static void PublishSwitchToBossFightAct(EventBossFightInit init)
{
if (init == null)
{
UnityEngine.Debug.LogError("[EventBossFightActTransition] EventBossFightInit 为空,已取消切换 Boss Act。");
return;
}
ApplyLoadingPanelAsActTransition(init);
var transition = string.IsNullOrEmpty(init.LoadingPanel)
? null
: UITypes.EventBossFightLoadingPanel;
GContext.Publish(new UnloadActToNextAct(BossFightActId, transition));
}
/// <summary>从 Boss 战 Act 回到 <see cref="FishingAct"/>。</summary>
public static void PublishSwitchToFishing(EventBossFightInit init)
{
ApplyLoadingPanelAsActTransition(init);
var transition = string.IsNullOrEmpty(init?.LoadingPanel)
? null
: UITypes.EventBossFightLoadingPanel;
GContext.Publish(new UnloadActToNextAct("FishingAct", transition));
}
}
}