更新YooAsset HybridCLR
This commit is contained in:
@@ -58,7 +58,7 @@ public class CopyBuildinManifestOperation : GameAsyncOperation
|
||||
string sourcePath = GetBuildinHashFilePath();
|
||||
string destPath = GetCacheHashFilePath();
|
||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
||||
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
||||
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
|
||||
OperationSystem.StartOperation(_packageName, _hashFileRequestOp);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class CopyBuildinManifestOperation : GameAsyncOperation
|
||||
string sourcePath = GetBuildinManifestFilePath();
|
||||
string destPath = GetCacheManifestFilePath();
|
||||
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
|
||||
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath);
|
||||
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
|
||||
OperationSystem.StartOperation(_packageName, _manifestFileRequestOp);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41ab464f315df234fb40b0c24e97ee23
|
||||
guid: 1cfb45518e8404846b5d7fcae445c678
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using YooAsset;
|
||||
|
||||
/// <summary>
|
||||
/// 获取包体里的内置资源清单版本
|
||||
/// </summary>
|
||||
public class GetBuildinPackageVersionOperation : GameAsyncOperation
|
||||
{
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
GetPackageVersion,
|
||||
Done,
|
||||
}
|
||||
|
||||
private readonly string _packageName;
|
||||
private UnityWebTextRequestOperation _versionFileRequestOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
/// <summary>
|
||||
/// 内置资源清单版本
|
||||
/// </summary>
|
||||
public string PackageVersion { private set; get; }
|
||||
|
||||
public GetBuildinPackageVersionOperation(string packageName)
|
||||
{
|
||||
_packageName = packageName;
|
||||
}
|
||||
protected override void OnStart()
|
||||
{
|
||||
_steps = ESteps.GetPackageVersion;
|
||||
}
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.GetPackageVersion)
|
||||
{
|
||||
if (_versionFileRequestOp == null)
|
||||
{
|
||||
string filePath = GetBuildinPackageVersionFilePath();
|
||||
string url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||
_versionFileRequestOp = new UnityWebTextRequestOperation(url, 60);
|
||||
OperationSystem.StartOperation(_packageName, _versionFileRequestOp);
|
||||
}
|
||||
|
||||
if (_versionFileRequestOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_versionFileRequestOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
PackageVersion = _versionFileRequestOp.Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _versionFileRequestOp.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnAbort()
|
||||
{
|
||||
}
|
||||
|
||||
private string GetBuildinYooRoot()
|
||||
{
|
||||
return YooAssetSettingsData.GetYooDefaultBuildinRoot();
|
||||
}
|
||||
private string GetBuildinPackageVersionFilePath()
|
||||
{
|
||||
string fileRoot = GetBuildinYooRoot();
|
||||
string fileName = YooAssetSettingsData.GetPackageVersionFileName(_packageName);
|
||||
return PathUtility.Combine(fileRoot, _packageName, fileName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 609e1ce54918dab40900d532704b1187
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8790bf5eb17db6843b696018a2b1ce6a
|
||||
guid: e7411f91151d98644952c22e66b2ab6e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35cd25a83a43dfb4093399183b31a0d0
|
||||
guid: 1fdd7622a256fee4cbb1eadb04fcf769
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55478908ad5dc5541af1529a3faccee7
|
||||
guid: ed2dbde46bd8faf4f972d7c6fb8ad163
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
Reference in New Issue
Block a user