mirror of https://github.com/tuyoogame/YooAsset
update operation system
parent
c0df366676
commit
d980b55997
|
@ -19,7 +19,6 @@ namespace YooAsset
|
|||
private readonly DefaultBuildinFileSystem _fileSystem;
|
||||
private readonly PackageBundle _bundle;
|
||||
private AssetBundleCreateRequest _createRequest;
|
||||
private bool _isWaitForAsyncComplete = false;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
|
||||
|
@ -53,7 +52,7 @@ namespace YooAsset
|
|||
}
|
||||
}
|
||||
|
||||
if (_isWaitForAsyncComplete)
|
||||
if (IsWaitForAsyncComplete)
|
||||
{
|
||||
if (_bundle.Encrypted)
|
||||
{
|
||||
|
@ -85,7 +84,7 @@ namespace YooAsset
|
|||
{
|
||||
if (_createRequest != null)
|
||||
{
|
||||
if (_isWaitForAsyncComplete)
|
||||
if (IsWaitForAsyncComplete)
|
||||
{
|
||||
// 强制挂起主线程(注意:该操作会很耗时)
|
||||
YooLogger.Warning("Suspend the main thread to load unity bundle.");
|
||||
|
@ -124,8 +123,6 @@ namespace YooAsset
|
|||
}
|
||||
internal override void InternalWaitForAsyncComplete()
|
||||
{
|
||||
_isWaitForAsyncComplete = true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (ExecuteWhileDone())
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace YooAsset
|
|||
protected readonly PackageBundle _bundle;
|
||||
protected FSDownloadFileOperation _downloadFileOp;
|
||||
protected AssetBundleCreateRequest _createRequest;
|
||||
protected bool _isWaitForAsyncComplete = false;
|
||||
protected ESteps _steps = ESteps.None;
|
||||
|
||||
|
||||
|
@ -90,7 +89,7 @@ namespace YooAsset
|
|||
}
|
||||
}
|
||||
|
||||
if (_isWaitForAsyncComplete)
|
||||
if (IsWaitForAsyncComplete)
|
||||
{
|
||||
if (_bundle.Encrypted)
|
||||
{
|
||||
|
@ -122,7 +121,7 @@ namespace YooAsset
|
|||
{
|
||||
if (_createRequest != null)
|
||||
{
|
||||
if (_isWaitForAsyncComplete)
|
||||
if (IsWaitForAsyncComplete)
|
||||
{
|
||||
// 强制挂起主线程(注意:该操作会很耗时)
|
||||
YooLogger.Warning("Suspend the main thread to load unity bundle.");
|
||||
|
@ -197,8 +196,6 @@ namespace YooAsset
|
|||
}
|
||||
internal override void InternalWaitForAsyncComplete()
|
||||
{
|
||||
_isWaitForAsyncComplete = true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (_downloadFileOp != null)
|
||||
|
|
|
@ -12,6 +12,11 @@ namespace YooAsset
|
|||
private string _packageName = null;
|
||||
private int _whileFrame = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// 等待异步执行完成
|
||||
/// </summary>
|
||||
internal bool IsWaitForAsyncComplete = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否已经完成
|
||||
/// </summary>
|
||||
|
@ -168,6 +173,7 @@ namespace YooAsset
|
|||
if (IsDone)
|
||||
return;
|
||||
|
||||
IsWaitForAsyncComplete = true;
|
||||
InternalWaitForAsyncComplete();
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace YooAsset
|
|||
protected ESteps _steps = ESteps.None;
|
||||
protected LoadBundleFileOperation LoadBundleFileOp { private set; get; }
|
||||
protected LoadDependBundleFileOperation LoadDependBundleFileOp { private set; get; }
|
||||
protected bool IsWaitForAsyncComplete { private set; get; } = false;
|
||||
private readonly List<HandleBase> _handles = new List<HandleBase>();
|
||||
|
||||
|
||||
|
@ -93,8 +92,6 @@ namespace YooAsset
|
|||
|
||||
internal override void InternalWaitForAsyncComplete()
|
||||
{
|
||||
IsWaitForAsyncComplete = true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (LoadDependBundleFileOp != null)
|
||||
|
|
Loading…
Reference in New Issue