增加查询预下载资源版本方法

pull/254/head
unknown 2024-03-15 10:21:20 +08:00
parent abaff0ede5
commit 99eb8774e0
2 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace YooAsset
@ -21,7 +21,7 @@ namespace YooAsset
private int _requestCount = 0;
/// <summary>
/// 包裹版本
/// 包裹版本
/// </summary>
public string PrePackageVersion { private set; get; }
@ -48,7 +48,7 @@ namespace YooAsset
if (_downloader == null)
{
string fileName = YooAssetSettingsData.GetPrePackageVersionFileName(_packageName);
string webURL = GetPackageVersionRequestURL(fileName);
string webURL = GetPackageVersionRequestURL(_packageName, fileName);
YooLogger.Log($"Beginning to request pre package version : {webURL}");
_downloader = new UnityWebDataRequester();
_downloader.SendRequest(webURL, _timeout);
@ -86,17 +86,17 @@ namespace YooAsset
}
}
private string GetPackageVersionRequestURL(string fileName)
private string GetPackageVersionRequestURL(string packageName, string fileName)
{
string url;
// 轮流返回请求地址
// 轮流返回请求地址
if (_requestCount % 2 == 0)
url = _remoteServices.GetRemoteMainURL(fileName);
url = _remoteServices.GetRemoteMainURL(packageName, fileName);
else
url = _remoteServices.GetRemoteFallbackURL(fileName);
url = _remoteServices.GetRemoteFallbackURL(packageName, fileName);
// 在URL末尾添加时间戳
// 在URL末尾添加时间戳
if (_appendTimeTicks)
return $"{url}?{System.DateTime.UtcNow.Ticks}";
else

View File

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -7,12 +7,12 @@ namespace YooAsset
public abstract class UpdatePrePackageVersionOperation : AsyncOperationBase
{
/// <summary>
/// 预下载包裹版本
/// 预下载包裹版本
/// </summary>
public string PrePackageVersion { protected set; get; }
}
/// <summary>
/// 编辑器下模拟模式的请求远端包裹的预下载版本
/// 编辑器下模拟模式的请求远端包裹的预下载版本
/// </summary>
internal sealed class EditorPlayModeUpdatePrePackageVersionOperation : UpdatePrePackageVersionOperation
{
@ -26,7 +26,7 @@ namespace YooAsset
}
/// <summary>
/// 离线模式的请求远端包裹的预下载版本
/// 离线模式的请求远端包裹的预下载版本
/// </summary>
internal sealed class OfflinePlayModeUpdatePrePackageVersionOperation : UpdatePrePackageVersionOperation
{
@ -40,7 +40,7 @@ namespace YooAsset
}
/// <summary>
/// 联机模式的请求远端包裹的预下载版本
/// 联机模式的请求远端包裹的预下载版本
/// </summary>
internal sealed class HostPlayModeUpdatePrePackageVersionOperation : UpdatePrePackageVersionOperation
{
@ -100,7 +100,7 @@ namespace YooAsset
}
/// <summary>
/// WebGL模式的请求远端包裹的预下载版本
/// WebGL模式的请求远端包裹的预下载版本
/// </summary>
internal sealed class WebPlayModeUpdatePrePackageVersionOperation : UpdatePrePackageVersionOperation
{