升级YooAsset->2.1.1、UniTask->2.5.4

升级YooAsset->2.1.1、UniTask->2.5.4
This commit is contained in:
ALEXTANG
2024-04-15 19:37:42 +08:00
parent 83bea559e4
commit d75c1c8c93
88 changed files with 955 additions and 361 deletions

View File

@@ -332,6 +332,7 @@ namespace YooAsset
{
PackageVersion = _loadBuildinManifestOp.Manifest.PackageVersion;
_impl.ActiveManifest = _loadBuildinManifestOp.Manifest;
_impl.FlushManifestVersionFile(); //注意:解压内置清单并加载成功后保存该清单版本。
_steps = ESteps.PackageCaching;
}
else

View File

@@ -77,7 +77,7 @@ namespace YooAsset
return;
}
string fileHash = HashUtility.FileMD5(_manifestFilePath);
string fileHash = HashUtility.FileMD5Safely(_manifestFilePath);
if (fileHash != _queryCachePackageHashOp.PackageHash)
{
_steps = ESteps.Done;

View File

@@ -63,7 +63,6 @@ namespace YooAsset
TryLoadCacheManifest,
DownloadManifest,
LoadCacheManifest,
CheckDeserializeManifest,
Done,
}

View File

@@ -10,6 +10,7 @@ namespace YooAsset
private ResourceAssist _assist;
private IBuildinQueryServices _buildinQueryServices;
private IRemoteServices _remoteServices;
private IWechatQueryServices _wechatQueryServices;
public readonly string PackageName;
public DownloadManager Download
@@ -34,11 +35,12 @@ namespace YooAsset
/// <summary>
/// 异步初始化
/// </summary>
public InitializationOperation InitializeAsync(ResourceAssist assist, IBuildinQueryServices buildinQueryServices, IRemoteServices remoteServices)
public InitializationOperation InitializeAsync(ResourceAssist assist, IBuildinQueryServices buildinQueryServices, IRemoteServices remoteServices, IWechatQueryServices wechatQueryServices)
{
_assist = assist;
_buildinQueryServices = buildinQueryServices;
_remoteServices = remoteServices;
_wechatQueryServices = wechatQueryServices;
var operation = new WebPlayModeInitializationOperation(this);
OperationSystem.StartOperation(PackageName, operation);
@@ -65,23 +67,13 @@ namespace YooAsset
}
// 查询相关
#if UNITY_WECHAT_GAME
private WeChatWASM.WXFileSystemManager _wxFileSystemMgr;
private bool IsCachedPackageBundle(PackageBundle packageBundle)
{
if (_wxFileSystemMgr == null)
_wxFileSystemMgr = WeChatWASM.WX.GetFileSystemManager();
string filePath = WeChatWASM.WX.env.USER_DATA_PATH + packageBundle.FileName;
string result = _wxFileSystemMgr.AccessSync(filePath);
return result.Equals("access:ok");
if (_wechatQueryServices != null)
return _wechatQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
else
return false;
}
#else
private bool IsCachedPackageBundle(PackageBundle packageBundle)
{
return false;
}
#endif
private bool IsBuildinPackageBundle(PackageBundle packageBundle)
{
return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);

View File

@@ -184,7 +184,8 @@ namespace YooAsset
var initializeParameters = parameters as WebPlayModeParameters;
initializeOperation = webPlayModeImpl.InitializeAsync(assist,
initializeParameters.BuildinQueryServices,
initializeParameters.RemoteServices);
initializeParameters.RemoteServices,
initializeParameters.WechatQueryServices);
}
else
{