mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-30 13:38:46 +00:00
update resource manager
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -158,5 +159,19 @@ namespace YooAsset
|
|||||||
|
|
||||||
private TaskCompletionSource<object> _taskCompletionSource;
|
private TaskCompletionSource<object> _taskCompletionSource;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 调试方法
|
||||||
|
[Conditional("DEBUG")]
|
||||||
|
protected void DebugCheckWaitForAsyncComplete(string error = null)
|
||||||
|
{
|
||||||
|
if (IsDone == false)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(error))
|
||||||
|
YooLogger.Error($"Operation {this.GetType().Name} failed to wait for async complete !");
|
||||||
|
else
|
||||||
|
YooLogger.Error($"Operation {this.GetType().Name} failed to wait for async complete ! {error}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,10 +77,12 @@ namespace YooAsset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void WaitForAsyncComplete()
|
public override void WaitForAsyncComplete()
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.Done)
|
if (_steps == ESteps.Clone)
|
||||||
return;
|
{
|
||||||
_handle.WaitForAsyncComplete();
|
_handle.WaitForAsyncComplete();
|
||||||
InternalOnUpdate();
|
InternalOnUpdate();
|
||||||
|
DebugCheckWaitForAsyncComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
@@ -58,5 +57,10 @@ namespace YooAsset
|
|||||||
Status = EOperationStatus.Succeed;
|
Status = EOperationStatus.Succeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public override void WaitForAsyncComplete()
|
||||||
|
{
|
||||||
|
InternalOnUpdate();
|
||||||
|
DebugCheckWaitForAsyncComplete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,9 +42,7 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.CheckBundle)
|
if (_steps == ESteps.CheckBundle)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
{
|
|
||||||
FileLoader.WaitForAsyncComplete();
|
FileLoader.WaitForAsyncComplete();
|
||||||
}
|
|
||||||
|
|
||||||
if (FileLoader.IsDone() == false)
|
if (FileLoader.IsDone() == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.CheckBundle)
|
if (_steps == ESteps.CheckBundle)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
{
|
|
||||||
FileLoader.WaitForAsyncComplete();
|
FileLoader.WaitForAsyncComplete();
|
||||||
}
|
|
||||||
|
|
||||||
if (FileLoader.IsDone() == false)
|
if (FileLoader.IsDone() == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.CheckBundle)
|
if (_steps == ESteps.CheckBundle)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
{
|
|
||||||
FileLoader.WaitForAsyncComplete();
|
FileLoader.WaitForAsyncComplete();
|
||||||
}
|
|
||||||
|
|
||||||
if (FileLoader.IsDone() == false)
|
if (FileLoader.IsDone() == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -37,9 +37,7 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.CheckBundle)
|
if (_steps == ESteps.CheckBundle)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
{
|
|
||||||
FileLoader.WaitForAsyncComplete();
|
FileLoader.WaitForAsyncComplete();
|
||||||
}
|
|
||||||
|
|
||||||
if (FileLoader.IsDone() == false)
|
if (FileLoader.IsDone() == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ namespace YooAsset
|
|||||||
if (_steps == ESteps.CheckBundle)
|
if (_steps == ESteps.CheckBundle)
|
||||||
{
|
{
|
||||||
if (IsWaitForAsyncComplete)
|
if (IsWaitForAsyncComplete)
|
||||||
{
|
|
||||||
FileLoader.WaitForAsyncComplete();
|
FileLoader.WaitForAsyncComplete();
|
||||||
}
|
|
||||||
|
|
||||||
if (FileLoader.IsDone() == false)
|
if (FileLoader.IsDone() == false)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -102,12 +102,7 @@ namespace YooAsset
|
|||||||
|
|
||||||
// 注意:主动轮询更新完成同步加载
|
// 注意:主动轮询更新完成同步加载
|
||||||
InternalOnUpdate();
|
InternalOnUpdate();
|
||||||
|
DebugCheckWaitForAsyncComplete($"Loading asset {MainAssetInfo.AssetPath}");
|
||||||
// 验证结果
|
|
||||||
if (IsDone == false)
|
|
||||||
{
|
|
||||||
YooLogger.Warning($"{nameof(WaitForAsyncComplete)} failed to loading : {MainAssetInfo.AssetPath}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user