36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
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}";
|
||
}
|
||
}
|
||
}
|