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

36 lines
1.4 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 cfg;
namespace EventBossFight
{
/// <summary>
/// Boss 视频按关 Addressables配置表 <see cref="EventBossFightInit.AssetBundle"/> 为前缀,
/// 第 N 关 key 为 「前缀_N」如 atlantis_boss_4。活动主界面 / 复盘均依赖此字段,不可为空。
/// </summary>
public static class EventBossFightBossBundleKeys
{
/// <summary>
/// Boss 分包在 LoadResourceService.CheckResourceLoadQueue 中的分组 key 前缀;
/// 入口、主界面、复盘共用同一优先级(同一队列记录维度)。
/// </summary>
public const string BossResourceLoadQueuePrefix = "EventBossFightBoss";
/// <summary>与 Addressables 地址 <paramref name="addressableKey"/> 对应的下载队列 key。</summary>
public static string GetBossResourceLoadQueueKey(string addressableKey)
{
if (string.IsNullOrEmpty(addressableKey))
return null;
return $"{BossResourceLoadQueuePrefix}_{addressableKey}";
}
public static bool ShouldUsePerStageBoss(EventBossFightInit init) =>
init != null && !string.IsNullOrEmpty(init.AssetBundle);
public static string GetAddressableKey(EventBossFightInit init, int stageFrom1)
{
if (!ShouldUsePerStageBoss(init) || stageFrom1 < 1)
return null;
return $"{init.AssetBundle}_{stageFrom1}";
}
}
}