52 lines
2.2 KiB
C#
52 lines
2.2 KiB
C#
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));
|
||
}
|
||
}
|
||
}
|