Update runtime logic

This commit is contained in:
hevinci
2022-09-27 21:11:55 +08:00
parent e1801a5fba
commit af37bb6e54
13 changed files with 176 additions and 307 deletions
@@ -78,21 +78,23 @@ namespace YooAsset
private static int RequestCount = 0;
private readonly HostPlayModeImpl _impl;
private readonly int _resourceVersion;
private readonly string _packageName;
private readonly string _packageCRC;
private readonly int _timeout;
private ESteps _steps = ESteps.None;
private UnityWebDataRequester _downloader;
private PatchManifest _remotePatchManifest;
internal HostPlayModeUpdatePackageOperation(HostPlayModeImpl impl, int resourceVersion, int timeout)
internal HostPlayModeUpdatePackageOperation(HostPlayModeImpl impl, string packageName, string packageCRC, int timeout)
{
_impl = impl;
_resourceVersion = resourceVersion;
_packageName = packageName;
_packageCRC = packageCRC;
_timeout = timeout;
}
internal override void Start()
{
RequestCount++;
RequestCount++;
_steps = ESteps.LoadWebManifest;
}
internal override void Update()
@@ -102,7 +104,8 @@ namespace YooAsset
if (_steps == ESteps.LoadWebManifest)
{
string webURL = GetPatchManifestRequestURL(YooAssetSettingsData.GetPatchManifestFileName(_resourceVersion));
string fileName = YooAssetSettingsData.GetPatchManifestFileName(_packageName, _packageCRC);
string webURL = GetPatchManifestRequestURL(fileName);
YooLogger.Log($"Beginning to request patch manifest : {webURL}");
_downloader = new UnityWebDataRequester();
_downloader.SendRequest(webURL, _timeout);