mirror of https://github.com/tuyoogame/YooAsset
Compare commits
1 Commits
b327f5aa09
...
5222490f06
Author | SHA1 | Date |
---|---|---|
BoysheO | 5222490f06 |
|
@ -33,14 +33,6 @@ namespace YooAsset.Editor
|
||||||
if (AssetDatabase.IsValidFolder(assetInfo.AssetPath))
|
if (AssetDatabase.IsValidFolder(assetInfo.AssetPath))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// 忽略编辑器图标资源
|
|
||||||
if (assetInfo.AssetPath.Contains("/Gizmos/"))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// 忽略编辑器专属资源
|
|
||||||
if (assetInfo.AssetPath.Contains("/Editor/") || assetInfo.AssetPath.Contains("/Editor Resources/"))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// 忽略编辑器下的类型资源
|
// 忽略编辑器下的类型资源
|
||||||
if (assetInfo.AssetType == typeof(LightingDataAsset))
|
if (assetInfo.AssetType == typeof(LightingDataAsset))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -94,9 +94,6 @@ namespace YooAsset
|
||||||
// 等待验证完成
|
// 等待验证完成
|
||||||
if (_steps == ESteps.CheckVerifyTempFile)
|
if (_steps == ESteps.CheckVerifyTempFile)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
_verifyOperation.WaitForAsyncComplete();
|
|
||||||
|
|
||||||
if (_verifyOperation.IsDone == false)
|
if (_verifyOperation.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -157,6 +154,9 @@ namespace YooAsset
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (_verifyOperation != null)
|
||||||
|
_verifyOperation.WaitForAsyncComplete();
|
||||||
|
|
||||||
// 注意:如果是导入或解压本地文件,执行等待完毕
|
// 注意:如果是导入或解压本地文件,执行等待完毕
|
||||||
if (isReuqestLocalFile)
|
if (isReuqestLocalFile)
|
||||||
{
|
{
|
||||||
|
@ -305,9 +305,6 @@ namespace YooAsset
|
||||||
// 等待验证完成
|
// 等待验证完成
|
||||||
if (_steps == ESteps.CheckVerifyTempFile)
|
if (_steps == ESteps.CheckVerifyTempFile)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
_verifyOperation.WaitForAsyncComplete();
|
|
||||||
|
|
||||||
if (_verifyOperation.IsDone == false)
|
if (_verifyOperation.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -367,6 +364,9 @@ namespace YooAsset
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (_verifyOperation != null)
|
||||||
|
_verifyOperation.WaitForAsyncComplete();
|
||||||
|
|
||||||
// 注意:如果是导入或解压本地文件,执行等待完毕
|
// 注意:如果是导入或解压本地文件,执行等待完毕
|
||||||
if (isReuqestLocalFile)
|
if (isReuqestLocalFile)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,9 +58,6 @@ namespace YooAsset
|
||||||
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
_downloadFileOp.WaitForAsyncComplete();
|
|
||||||
|
|
||||||
DownloadProgress = _downloadFileOp.DownloadProgress;
|
DownloadProgress = _downloadFileOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
||||||
if (_downloadFileOp.IsDone == false)
|
if (_downloadFileOp.IsDone == false)
|
||||||
|
@ -201,6 +198,9 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (_downloadFileOp != null)
|
||||||
|
_downloadFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
if (ExecuteWhileDone())
|
if (ExecuteWhileDone())
|
||||||
{
|
{
|
||||||
if (_downloadFileOp != null && _downloadFileOp.Status == EOperationStatus.Failed)
|
if (_downloadFileOp != null && _downloadFileOp.Status == EOperationStatus.Failed)
|
||||||
|
@ -274,9 +274,6 @@ namespace YooAsset
|
||||||
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
_downloadFileOp.WaitForAsyncComplete();
|
|
||||||
|
|
||||||
DownloadProgress = _downloadFileOp.DownloadProgress;
|
DownloadProgress = _downloadFileOp.DownloadProgress;
|
||||||
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
DownloadedBytes = _downloadFileOp.DownloadedBytes;
|
||||||
if (_downloadFileOp.IsDone == false)
|
if (_downloadFileOp.IsDone == false)
|
||||||
|
@ -316,6 +313,9 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (_downloadFileOp != null)
|
||||||
|
_downloadFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
if (ExecuteWhileDone())
|
if (ExecuteWhileDone())
|
||||||
{
|
{
|
||||||
if (_downloadFileOp != null && _downloadFileOp.Status == EOperationStatus.Failed)
|
if (_downloadFileOp != null && _downloadFileOp.Status == EOperationStatus.Failed)
|
||||||
|
|
|
@ -16,7 +16,6 @@ namespace YooAsset
|
||||||
DownloadProgress = 1f;
|
DownloadProgress = 1f;
|
||||||
DownloadedBytes = _bundle.FileSize;
|
DownloadedBytes = _bundle.FileSize;
|
||||||
Status = EOperationStatus.Succeed;
|
Status = EOperationStatus.Succeed;
|
||||||
Result = new VirtualBundle(_fileSystem, _bundle);
|
|
||||||
}
|
}
|
||||||
internal override void InternalOnUpdate()
|
internal override void InternalOnUpdate()
|
||||||
{
|
{
|
||||||
|
|
|
@ -147,7 +147,7 @@ namespace YooAsset
|
||||||
|
|
||||||
// 当执行次数用完时
|
// 当执行次数用完时
|
||||||
_whileFrame--;
|
_whileFrame--;
|
||||||
if (_whileFrame <= 0)
|
if (_whileFrame == 0)
|
||||||
{
|
{
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
Error = $"Operation {this.GetType().Name} failed to wait for async complete !";
|
Error = $"Operation {this.GetType().Name} failed to wait for async complete !";
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: a9ca0d0d29eb5294b9c6926c6a09e76b
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
namespace YooAsset
|
|
||||||
{
|
|
||||||
internal class VirtualBundle
|
|
||||||
{
|
|
||||||
private readonly IFileSystem _fileSystem;
|
|
||||||
private readonly PackageBundle _packageBundle;
|
|
||||||
|
|
||||||
internal VirtualBundle(IFileSystem fileSystem, PackageBundle packageBundle)
|
|
||||||
{
|
|
||||||
_fileSystem = fileSystem;
|
|
||||||
_packageBundle = packageBundle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 822bb85f05144d842977dda341174db2
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -69,29 +69,17 @@ namespace YooAsset
|
||||||
if (_loadBundleOp == null)
|
if (_loadBundleOp == null)
|
||||||
_loadBundleOp = BundleFileInfo.LoadBundleFile();
|
_loadBundleOp = BundleFileInfo.LoadBundleFile();
|
||||||
|
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
_loadBundleOp.WaitForAsyncComplete();
|
|
||||||
|
|
||||||
DownloadProgress = _loadBundleOp.DownloadProgress;
|
DownloadProgress = _loadBundleOp.DownloadProgress;
|
||||||
DownloadedBytes = _loadBundleOp.DownloadedBytes;
|
DownloadedBytes = _loadBundleOp.DownloadedBytes;
|
||||||
if (_loadBundleOp.IsDone == false)
|
if (_loadBundleOp.IsDone == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_loadBundleOp.Status == EOperationStatus.Succeed)
|
if (_loadBundleOp.Status == EOperationStatus.Succeed)
|
||||||
{
|
|
||||||
if (_loadBundleOp.Result == null)
|
|
||||||
{
|
|
||||||
_steps = ESteps.Done;
|
|
||||||
Status = EOperationStatus.Failed;
|
|
||||||
Error = $"The bundle loader result is null ! {BundleFileInfo.Bundle.BundleName}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
Result = _loadBundleOp.Result;
|
Result = _loadBundleOp.Result;
|
||||||
Status = EOperationStatus.Succeed;
|
Status = EOperationStatus.Succeed;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
|
@ -104,6 +92,9 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
if (_loadBundleOp != null)
|
||||||
|
_loadBundleOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
if (ExecuteWhileDone())
|
if (ExecuteWhileDone())
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
|
|
|
@ -36,14 +36,6 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_steps == ESteps.CheckDepend)
|
if (_steps == ESteps.CheckDepend)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
|
||||||
{
|
|
||||||
foreach (var loader in Depends)
|
|
||||||
{
|
|
||||||
loader.WaitForAsyncComplete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var loader in Depends)
|
foreach (var loader in Depends)
|
||||||
{
|
{
|
||||||
if (loader.IsDone == false)
|
if (loader.IsDone == false)
|
||||||
|
@ -81,6 +73,11 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
foreach (var loader in Depends)
|
||||||
|
{
|
||||||
|
loader.WaitForAsyncComplete();
|
||||||
|
}
|
||||||
|
|
||||||
if (ExecuteWhileDone())
|
if (ExecuteWhileDone())
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
|
|
|
@ -96,7 +96,6 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
if (LoadDependBundleFileOp != null)
|
if (LoadDependBundleFileOp != null)
|
||||||
LoadDependBundleFileOp.WaitForAsyncComplete();
|
LoadDependBundleFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
if (LoadBundleFileOp != null)
|
if (LoadBundleFileOp != null)
|
||||||
LoadBundleFileOp.WaitForAsyncComplete();
|
LoadBundleFileOp.WaitForAsyncComplete();
|
||||||
|
|
||||||
|
|
|
@ -176,16 +176,6 @@ namespace YooAsset
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测文件系统参数
|
|
||||||
if (_playMode == EPlayMode.WebPlayMode)
|
|
||||||
{
|
|
||||||
var webPlayModeParams = parameters as WebPlayModeParameters;
|
|
||||||
var fileSystemClassName = webPlayModeParams.WebFileSystemParameters.FileSystemClass;
|
|
||||||
if (fileSystemClassName == typeof(DefaultCacheFileSystem).FullName
|
|
||||||
|| fileSystemClassName == typeof(DefaultBuildinFileSystem).FullName)
|
|
||||||
throw new Exception($"{fileSystemClassName} not support {nameof(EPlayMode.WebPlayMode)}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void InitializeOperation_Completed(AsyncOperationBase op)
|
private void InitializeOperation_Completed(AsyncOperationBase op)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue