All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 10s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 5s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 32s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 4s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 16s
Plugin Library CI / publish (07.RKTools) (push) Successful in 3s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 3s
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using YooAsset;
|
||
namespace Stary.Evo
|
||
{
|
||
|
||
|
||
public class RemoteServices : IRemoteServices
|
||
{
|
||
private readonly string _mainHost;
|
||
private readonly string _fallbackHost;
|
||
|
||
public RemoteServices(string mainHost, string fallbackHost = null)
|
||
{
|
||
_mainHost = mainHost.TrimEnd('/');
|
||
_fallbackHost = string.IsNullOrEmpty(fallbackHost)
|
||
? _mainHost
|
||
: fallbackHost.TrimEnd('/');
|
||
}
|
||
|
||
/// <summary>
|
||
/// 主下载地址(YooAsset 会优先使用)
|
||
/// fileName 示例:DefaultPackage/StaticAssets/DefaultPackage.version
|
||
/// </summary>
|
||
public string GetRemoteMainURL(string fileName)
|
||
{
|
||
return $"{_mainHost}/{fileName}";
|
||
}
|
||
|
||
/// <summary>
|
||
/// 备用下载地址(主地址失败时自动重试)
|
||
/// </summary>
|
||
public string GetRemoteFallbackURL(string fileName)
|
||
{
|
||
return $"{_fallbackHost}/{fileName}";
|
||
}
|
||
}
|
||
} |