Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling. Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
941 B
C#
36 lines
941 B
C#
using System.Collections.Generic;
|
|
using YooAsset;
|
|
|
|
namespace AOT.Patch
|
|
{
|
|
/// <summary>
|
|
/// YooAsset 远端地址查询(CDN)。
|
|
/// </summary>
|
|
public sealed class CdnRemoteService : IRemoteService
|
|
{
|
|
readonly string _primary;
|
|
readonly string _fallback;
|
|
|
|
public CdnRemoteService(string primaryRoot, string fallbackRoot = null)
|
|
{
|
|
_primary = TrimSlash(primaryRoot);
|
|
_fallback = string.IsNullOrEmpty(fallbackRoot) ? _primary : TrimSlash(fallbackRoot);
|
|
}
|
|
|
|
public IReadOnlyList<string> GetRemoteUrls(string fileName)
|
|
{
|
|
return new[]
|
|
{
|
|
$"{_primary}/{fileName}",
|
|
$"{_fallback}/{fileName}",
|
|
};
|
|
}
|
|
|
|
static string TrimSlash(string root)
|
|
{
|
|
if (string.IsNullOrEmpty(root)) return string.Empty;
|
|
return root.TrimEnd('/');
|
|
}
|
|
}
|
|
}
|