update file system
修正2.3.11版本同步加载本地加密文件失败的问题。
This commit is contained in:
+21
-17
@@ -82,15 +82,31 @@ namespace YooAsset
|
||||
return oldDownloader;
|
||||
}
|
||||
|
||||
// 创建新的下载器
|
||||
DefaultDownloadFileOperation newDownloader;
|
||||
if (string.IsNullOrEmpty(options.LocalFilePath))
|
||||
// 获取下载地址
|
||||
if (string.IsNullOrEmpty(options.ImportFilePath))
|
||||
{
|
||||
// 远端下载地址
|
||||
// 注意:如果是解压文件系统类,这里会返回本地内置文件的下载路径
|
||||
options.MainURL = _fileSystem.RemoteServices.GetRemoteMainURL(bundle.FileName);
|
||||
options.FallbackURL = _fileSystem.RemoteServices.GetRemoteFallbackURL(bundle.FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 注意:把本地导入文件路径转换为下载器请求地址
|
||||
options.MainURL = DownloadSystemHelper.ConvertToWWWPath(options.ImportFilePath);
|
||||
options.FallbackURL = options.MainURL;
|
||||
}
|
||||
|
||||
// 创建新的下载器
|
||||
// 创建新的下载器
|
||||
DefaultDownloadFileOperation newDownloader;
|
||||
bool isRequestLocalFile = DownloadSystemHelper.IsRequestLocalFile(options.MainURL);
|
||||
if (isRequestLocalFile)
|
||||
{
|
||||
newDownloader = new DownloadLocalFileOperation(_fileSystem, bundle, options);
|
||||
AddChildOperation(newDownloader);
|
||||
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bundle.FileSize >= _fileSystem.ResumeDownloadMinimumSize)
|
||||
{
|
||||
newDownloader = new DownloadResumeFileOperation(_fileSystem, bundle, options);
|
||||
@@ -104,18 +120,6 @@ namespace YooAsset
|
||||
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 注意:把本地文件路径指定为可下载地址
|
||||
options.MainURL = DownloadSystemHelper.ConvertToWWWPath(options.LocalFilePath);
|
||||
options.FallbackURL = options.MainURL;
|
||||
|
||||
// 创建新的下载器
|
||||
newDownloader = new DownloadLocalFileOperation(_fileSystem, bundle, options);
|
||||
AddChildOperation(newDownloader);
|
||||
_downloaders.Add(bundle.BundleGUID, newDownloader);
|
||||
}
|
||||
|
||||
return newDownloader;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -159,9 +159,12 @@ namespace YooAsset
|
||||
{
|
||||
if (ExecuteWhileDone())
|
||||
{
|
||||
//TODO 同步加载失败
|
||||
//TODO 尝试同步加载远端的资源文件失败
|
||||
if (Status == EOperationStatus.Failed)
|
||||
{
|
||||
YooLogger.Error($"Try load bundle {Bundle.BundleName} from remote !");
|
||||
YooLogger.Error($"The load remote bundle url : {_requestURL}");
|
||||
}
|
||||
|
||||
_steps = ESteps.Done;
|
||||
break;
|
||||
|
||||
+4
-1
@@ -177,9 +177,12 @@ namespace YooAsset
|
||||
{
|
||||
if (ExecuteWhileDone())
|
||||
{
|
||||
//TODO 同步加载失败
|
||||
//TODO 尝试同步加载远端的资源文件失败
|
||||
if (Status == EOperationStatus.Failed)
|
||||
{
|
||||
YooLogger.Error($"Try load bundle {Bundle.BundleName} from remote !");
|
||||
YooLogger.Error($"The load remote bundle url : {_requestURL}");
|
||||
}
|
||||
|
||||
_steps = ESteps.Done;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user